Giter Site home page Giter Site logo

daveeel / ostrio-neo4jdriver Goto Github PK

View Code? Open in Web Editor NEW

This project forked from veliovgroup/ostrio-neo4jdriver

0.0 1.0 0.0 270 KB

Meteor.js Neo4j Driver (Connector)

Home Page: https://atmospherejs.com/ostrio/neo4jdriver

License: BSD 3-Clause "New" or "Revised" License

HTML 5.82% CoffeeScript 89.97% CSS 3.53% JavaScript 0.68%

ostrio-neo4jdriver's Introduction

Join the chat at https://gitter.im/VeliovGroup/ostrio-neo4jdriver

See also Isomorphic Reactive Driver.

Install to meteor

meteor add ostrio:neo4jdriver

Demo Apps

API

Please see full API with examples in neo4j-fiber wiki

Basic Usage

db = new Neo4jDB 'http://localhost:7474', {
    username: 'neo4j'
    password: '1234'
  }
  
cursor = db.query 'CREATE (n:City {props}) RETURN n', 
  props: 
    title: 'Ottawa'
    lat: 45.416667
    long: -75.683333

console.log cursor.fetch()
# Returns array of nodes:
# [{
#   n: {
#     long: -75.683333,
#     lat: 45.416667,
#     title: "Ottawa",
#     id: 8421,
#     labels": ["City"],
#     metadata: {
#       id: 8421,
#       labels": ["City"]
#     }
#   }
# }]

# Iterate through results as plain objects:
cursor.forEach (node) ->
  console.log node
  # Returns node as Object:
  # {
  #   n: {
  #     long: -75.683333,
  #     lat: 45.416667,
  #     title: "Ottawa",
  #     id: 8421,
  #     labels": ["City"],
  #     metadata: {
  #       id: 8421,
  #       labels": ["City"]
  #     }
  #   }
  # }

# Iterate through cursor as `Neo4jNode` instances:
cursor.each (node) ->
  console.log node.n.get()
  # {
  #   long: -75.683333,
  #   lat: 45.416667,
  #   title: "Ottawa",
  #   id: 8421,
  #   labels": ["City"],
  #   metadata: {
  #     id: 8421,
  #     labels": ["City"]
  #   }
  # }

Testing & Dev usage

Local usage

To use the ostrio-neo4jdriver in a project and benefit from updates to the driver as they are released, you can keep your project and the driver in separate directories, and create a symlink between them.

# Stop meteor if it is running
$ cd /directory/of/your/project
# If you don't have a Meteor project yet, create a new one:
$ meteor create MyProject
$ cd MyProject
# Create `packages` directory inside project's dir
$ mkdir packages
$ cd packages
# Clone this repository to a local `packages` directory
$ git clone --bare https://github.com/VeliovGroup/ostrio-neo4jdriver.git
# If you need dev branch, switch into it
$ git checkout dev
# Go back into project's directory
$ cd ../
$ meteor add ostrio:neo4jdriver
# Do not forget to run Neo4j database, before start work with package

From now any changes in ostrio:neo4jdriver package folder will cause your project app to rebuild.

To run tests:
# Go to local package folder
$ cd packages/ostrio-neo4jdriver
# Edit first line of `tests.coffee` to set connection to your Neo4j database
# Do not forget to run Neo4j database
$ meteor test-packages ./

ostrio-neo4jdriver's People

Contributors

blackslate avatar dr-dimitru avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.