Code Monkey home page Code Monkey logo

meteor-neo4j's Introduction

Meteor Icon

Meteor Neo4j [MAINTAINER WANTED]

This package allows you to connect and query Neo4j from Meteor.

Check out this article.

Installation (Mac)

# install neo4j
brew install neo4j
# add ccorcos:neo4j to your project
meteor add ccorcos:neo4j
# start neo4j
neo4j start
# start meteor
meteor
# stop neo4j
neo4j stop

You can access the Neo4j admin browser interface here.

Commandline Utilities

m4j can start and stop Neo4j localized to your .meteor project.

curl -O https://raw.githubusercontent.com/ccorcos/meteor-neo4j/master/m4j
chmod +x m4j
# start within a meteor project
m4j start
# stop neo4j
m4j stop

m4j will edit the configuration files for Neo4j to do this so you need to provide a NEO4J_PATH environment variable. Put this in your ~/.bashrc:

export NEO4J_PATH=/usr/local/Cellar/neo4j/2.1.7

Also, meteor reset will clear Neo4j as well, but you may want to make sure to stop Neo4j before doing that.

API

You can create a Neo4j connection (url defaults to localhost:7474)

Neo4j = new Neo4jDb(optionalUrl)

Neo4j will be autoconnected if given Meteor.settings.neo4j_url or process.env.NEO4J_URL.

You can query Neo4j using Cypher.

result = Neo4j.query "MATCH (a) RETURN a"

When stringifying variables into Cypher queries, use Neo4j.stringify and Neo4j.regexify.

str = Neo4jDB.stringify
Neo4j.query "CREATE (p:PERSON #{str(user)}) RETURN p"

regex = Neo4jDB.regexify
Neo4j.query "CREATE (p:PERSON) WHERE p.name =~ #{regex(query)} RETURN p"

meteor-neo4j's People

Contributors

ccorcos avatar samcorcos avatar queso avatar

Stargazers

Grégory Horion avatar Logan Powell avatar  avatar @cdcme avatar  avatar Max avatar  avatar Sitao Z. avatar swh avatar Aiko Cheslin avatar Dan Minshew avatar Alexey Medvedev avatar Sunny Gonnabathula avatar Peter H. avatar Arun avatar Philipp Muens avatar Bozhao avatar Xianliang Wu avatar  avatar

Watchers

James Cloos avatar Aiko Cheslin avatar  avatar Xianliang Wu avatar  avatar

meteor-neo4j's Issues

Neo4jDB.stringify ReferenceError: isArray is not defined

I have the following error with Neo4jDB.stringify function:

> var user = {name: "John", age: 15}
> user.name
'John'
> Neo4jDB.stringify(user)
ReferenceError: isArray is not defined
    at Function.stringify (packages/ccorcos:neo4j/src/driver.coffee:19:6)
    at repl:1:10
    at /Users/meduza/Sites/blipper/.meteor/local/build/programs/server/shell-server.js:243:23
> 

Error not handled for wrong query syntax

When I pass wrong query it will return empty array i.e. [ ]. So its difficult to know there is error in query syntax or anything else. But if I entered wrong query at neo4j server it showed exact error in the query. So is there any way to handle such errors?

Meteor 1.4 import syntax

import { Neo4jDB } from 'meteor/ccorcos:neo4j';
console.log(Neo4jDB);

import { Neo4jDb } from 'meteor/ccorcos:neo4j';
console.log(Neo4jDb);

both of these return undefined in version 0.1.1

Your package.js says it exports Neo4jDB on the server. Is this actually what's going on? Are you able to update your package to support meteor 1.3+?

TypeError: undefined is not a function

Hi,

I was trying to run the example and this is what I get on STDERR:

=> Started proxy.
=> Started MongoDB.
I20160110-19:00:11.124(1)? [http://localhost:7474/db/data/] neo4j connecting...
I20160110-19:00:11.126(1)? [http://localhost:7474/db/data/] neo4j connected
W20160110-19:00:11.126(1)? (STDERR)
W20160110-19:00:11.126(1)? (STDERR) /Users/lusch/.meteor/packages/meteor-tool/.1.1.10.p2zb2e++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/fibers/future.js:245
W20160110-19:00:11.126(1)? (STDERR) throw(ex);
W20160110-19:00:11.126(1)? (STDERR) ^
W20160110-19:00:11.126(1)? (STDERR) TypeError: undefined is not a function
W20160110-19:00:11.127(1)? (STDERR) at server/server.js:1:9
W20160110-19:00:11.127(1)? (STDERR) at /Users/lusch/portfolio/fofoo/.meteor/local/build/programs/server/app/server/server.js:12:4
W20160110-19:00:11.127(1)? (STDERR) at /Users/lusch/portfolio/fofoo/.meteor/local/build/programs/server/boot.js:242:10
W20160110-19:00:11.127(1)? (STDERR) at Array.forEach (native)
W20160110-19:00:11.127(1)? (STDERR) at Function..each..forEach (/Users/lusch/.meteor/packages/meteor-tool/.1.1.10.p2zb2e++os.osx.x86_64+web.browser+web.cordova/mt-os.osx.x86_64/dev_bundle/server-lib/node_modules/underscore/underscore.js:79:11)
W20160110-19:00:11.127(1)? (STDERR) at /Users/lusch/portfolio/fofoo/.meteor/local/build/programs/server/boot.js:137:5
=> Exited with code: 8

My code is:
Neo4j = new Neo4jDB()

Did I missed something?

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.