All Projects → neo4-js → neo4-js

neo4-js / neo4-js

Licence: MIT license
Neo4-js is a object-graph mapper for JavaScript and neo4j with full flow-type support.

Programming Languages

typescript
32286 projects
shell
77523 projects

Projects that are alternatives of or similar to neo4-js

neo4j-ogm-university
Example Project for Neo4j OGM
Stars: ✭ 52 (+173.68%)
Mutual labels:  neo4j, ogm
gogm
Golang Object Graph Mapper for Neo4j
Stars: ✭ 71 (+273.68%)
Mutual labels:  neo4j, ogm
gram-js
Gram in javascript.
Stars: ✭ 21 (+10.53%)
Mutual labels:  neo4j
instacart-neo4j
Playing with Instacart data in Neo4j
Stars: ✭ 16 (-15.79%)
Mutual labels:  neo4j
graphcountries
An easy to use GraphQL API to query country-related data for free and without restrictions
Stars: ✭ 61 (+221.05%)
Mutual labels:  neo4j
bitnami-docker-neo4j
Bitnami Docker Image for Neo4j
Stars: ✭ 25 (+31.58%)
Mutual labels:  neo4j
aioneo4j
asyncio client for neo4j
Stars: ✭ 29 (+52.63%)
Mutual labels:  neo4j
django-test-addons
Testing support for different database system like Mongo, Redis, Neo4j, Memcache, Django Rest Framework for django
Stars: ✭ 20 (+5.26%)
Mutual labels:  neo4j
prov-db-connector
PROV Database Connector
Stars: ✭ 15 (-21.05%)
Mutual labels:  neo4j
family-tree
Family tree made with neo4j
Stars: ✭ 35 (+84.21%)
Mutual labels:  neo4j
nean-stack-starter
neo4j, express, angular, node
Stars: ✭ 30 (+57.89%)
Mutual labels:  neo4j
d3js-neo4j-example
Some of D3.js v5 example pages visualize the result from Neo4j
Stars: ✭ 37 (+94.74%)
Mutual labels:  neo4j
spuf-314
a Web Application prototype for public transportation, serving a RESTful API to find Stations, Bus, Metro and Tramway's Lines, while also computing the best multimodal path between two stations or addresses
Stars: ✭ 22 (+15.79%)
Mutual labels:  neo4j
decypher
A handful of cypher utilities for Node.js
Stars: ✭ 34 (+78.95%)
Mutual labels:  neo4j
datatheque.com
a data science blog
Stars: ✭ 12 (-36.84%)
Mutual labels:  neo4j
neo4j-java-driver-spring-boot-starter
Automatic configuration of Neo4j's Java Driver for Spring Boot applications
Stars: ✭ 33 (+73.68%)
Mutual labels:  neo4j
pheno4j
Pheno4j: a graph based HPO to NGS database
Stars: ✭ 31 (+63.16%)
Mutual labels:  neo4j
neo4j.cr
Pure-Crystal implementation of Neo4j's Bolt protocol
Stars: ✭ 29 (+52.63%)
Mutual labels:  neo4j
ml-models
Machine Learning Procedures and Functions for Neo4j
Stars: ✭ 63 (+231.58%)
Mutual labels:  neo4j
neo4j-graphql-java
Pure JVM translation for GraphQL queries and mutations to Neo4j's Cypher
Stars: ✭ 94 (+394.74%)
Mutual labels:  neo4j

Neo4-js

Build Status dependencies Status devDependencies Status styled with prettier

Neo4-js is a object-graph mapper for JavaScript and neo4j with full TypeScript support. Neo4-js hides repetitive queries such as the basic CRUD operations to the developer. For best development experience use TypeScript to obtain good autocomplete results.

Usage

With neo4-js you are able to quickly define your data model but maintain complete control over your models. The following code snipped shows how you can work with neo4-js.

type PersonProps = {
  name?: StringProperty;
};

type TaskProps = {
  title?: StringProperty;
  done?: boolean;
};

class PersonModel extends Model<PersonProps, PersonInstance> {}
const Person: PersonModel = new PersonModel("Person");

class TaskModel extends Model<TaskProps, TaskInstance> {}
const Task: TaskModel = new TaskModel("Task");

const TaskCreatorRelation = relation
  .from(() => Person)
  .to(() => Task)
  .via("created");

const TaskAssigneeRelation = relation
  .from(Person)
  .to(Task)
  .via("assigned");

@model(Person)
class PersonInstance extends ModelInstance<PersonProps> {
  @hasMany(Task, TaskCreatorRelation)
  tasks: HasManyActions<TaskProps, TaskInstance>;

  @hasMany(Task, TaskAssigneeRelation)
  assignedTasks: HasManyActions<TaskProps, TaskInstance>;
}

@model(Task)
class TaskInstance extends ModelInstance<TaskProps> {
  @hasOne(() => Person, () => TaskCreatorRelation)
  creator: HasOneActions<PersonProps, PersonInstance>;
}

(async () => {
  const paul: PersonInstance = await Person.create({ name: "Paul" });

  const propsArray: TaskProps[] = [
    {
      title: "Buy milk",
    },
    {
      title: "Buy beer",
      done: false,
    },
  ];

  const tasks: TaskInstance[] = await paul.tasks.create(propsArray);
})();

Documentation

The documentation is not completed yet but you'll find the basics on neo4.js.org. Any help is very much appreciated!

Installing

To use neo4-js properly you need to add TypeScript to your project. For now we also install ts-node so that we are able to run our code without compiling it manually before running.

yarn add -D typescript ts-node

I recommend using the following tsconfig.json configuration.

{
  "compilerOptions": {
    "module": "commonjs",
    "moduleResolution": "node",
    "target": "ES6",
    "experimentalDecorators": true,
  }
}

You might also install Docker to quickly create a neo4j database without any further installations. For neo4-js I used the following bash script to start a neo4j instance in docker. To run it you might create a scripts directory and add the following to neo4j-startup.sh, make sure you can execute the script with chmod 777 neo4j-startup.sh (because why not 777 on my local machine :P).

# REST PORT: 10000
# BOLT PORT: 10001
echo "docker run -p 10000:7474 -p 10001:7687 --rm --env=NEO4J_AUTH=none neo4j"
docker run -p 10000:7474 -p 10001:7687 --rm --env=NEO4J_AUTH=none neo4j

The only runtime dependency you need to start using neo4-js is neo4-js itself.

yarn add neo4-js

Built With

  • TypeScript - TypeScript is a typed superset of Javascript that compiles to plain Javascript.

Contributing

Feel free to send a pull request or create an issue for bugs or feature requests.

Authors

  • Jan Schlacher - Initial work

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].