Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Way to prevent replication until specific condition is met #67

Open
agjs opened this issue Apr 13, 2017 · 2 comments
Open

Way to prevent replication until specific condition is met #67

agjs opened this issue Apr 13, 2017 · 2 comments

Comments

@agjs
Copy link

agjs commented Apr 13, 2017

Hey guys,

This is not a technical issue but rather something I'm trying to figure out. Is there any way not to replicate data from mongo to neo4j until specific condition (logic) is satisfied. I have some data for instance that will be under "pending" status and I would want to insert it to neo4j only when the data is approved.

If this is not possible, anything you can suggest to make this happen ?

Thanks a bunch 👍

@johnymontana
Copy link

Currently, the configuration does not allow for conditionally replicating data. However, support for this could be added by inspecting the update. How would you prefer to define this logic? By checking the value of a property on the document?

Since you can currently specify what data is replicated at the collection (and property level), one way to make this work now would be to maintain the documents in two separate collections (say, pendingDocuments, and completedDocuments) and only replicate completedDocuments to Neo4j. Once the status changes, then move the documents from pendingDocuments to completedDocuments and they will then be replicated to Neo4j.

@agjs
Copy link
Author

agjs commented Apr 13, 2017

Oki, thanks a lot. I guess I'll do what you suggested and if this changes in the future, will switch to the conditional way.

Also another very important question while I have you here. Is there any other way to reference documents except something_id ? I realized that doc manager seeks for keys ending with _id and relates documents by the id.

Here is my mongoose schema and below it the results I would want to have replicated in neo4j:

{
  name: String,
  description: {
    type: String
  },
  types: [
    {
      name: String,
      description: String,
      names: [
        {
          name: String,
          description: String
        }
      ]
    }
  ]
}

nodes

Thanks a bunch :)!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants