Reputation: 2233
I am using mongo-connector and neo4j doc manager to stream some data into my neo4j instance. The data that is being inserted into the mongo database is coming from a Java application that's using Morphia to serialize the object.
The objects in my Java application are tied together with references to each other. Morphia is correctly translating that into the mongo database. Here is an example of two documents that link to one another:
{
"_id" : ObjectId("58fe606a43d7e22b34f65a16"),
"name" : "client",
"part" : 1
}
The mongo doc that points to the related doc:
{
"_id" : ObjectId("58fe606d43d7e22b34f65a1a"),
"correlatedObject" : ObjectId("58fe606a43d7e22b34f65a16"),
"name" : "guest",
"part" : 2
}
So you can see how the first example is a regular document with no correlatedObject
field. The second document points to the first. Now, it's my understanding that the neo4j doc manager should detect this relationship and build a query based on it. But as I am seeing it in neo4j, this relationship is never made and the two entities are never tied together in the graph.
So my question is: How do I define relationships - either in doc manager configuration or a format that the doc manager will understand - so that in neo4j, the two entities can visually be seen as related items.
Upvotes: 1
Views: 237
Reputation: 1388
Good question! According to their docs, this is how you do it:
Creating relationships by _id reference
Upvotes: 3