veliovgroup / ostrio-Neo4jreactivity

Meteor.js Neo4j database reactivity layer
https://atmospherejs.com/ostrio/neo4jreactivity
BSD 3-Clause "New" or "Revised" License
51 stars 5 forks source link

question on mapping to collections #28

Closed alexfrieden closed 9 years ago

alexfrieden commented 9 years ago

So we have originally used mongo and are switching to neo4jReactivity. We have a collection bits,

Bits = new Meteor.Collection("bits");

In server, we have a publications.js file to publish what is in the mongo collection. I would like to change that to neo4j results.

Meteor.publish('bits', function() { return Bits.find(); });

What is the best way to do that with Neo4jReactivity? Thanks!

dr-dimitru commented 9 years ago

@alexfrieden as you know neo4j doesn't have any collections, so thereis nothing to publish except certain queries. For this purpose please use Meteor.neo4j.call and Meteor.neo4j.methods, they act just like publish/subscribe for mongo

alexfrieden commented 9 years ago

And keep those at the publication layer?

dr-dimitru commented 9 years ago

@alexfrieden Sorry I didn't get your question.

alexfrieden commented 9 years ago

@dr-dimitru let me rephrase, should the cypher queries happen in the client or the server and get pushed to the client, and how would you push it?

dr-dimitru commented 9 years ago

@alexfrieden You may run queries both client and server. But it has same security policy as original mongo isomorphic driver - to avoid security issues manage it via methods/call .

Once you get data via client's query() or from server via call() - retrieved data is reactive, so updates will be pushed automatically

lifeinchords commented 9 years ago

Thanks for the info. We're working towards moving our app to neo4J. How does the fact that we're moving away from Meteor collection affect this: https://github.com/msavin/Mongol/blob/master/documentation/COMPATIBILITY.md

Do you think there's a way to get the best of both - neo4j, yet still retain ability to debug the neo4j "collections"?

dr-dimitru commented 9 years ago

@lifeinchords there is shouldn't be any issues in compatibility of neo4j driver with any other DB in Meteor. You can use Neo4j DB and any other simultaneously

alexfrieden commented 9 years ago

Great this helps a lot!