cancel
Showing results for 
Search instead for 
Did you mean: 

Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.

Saving embedded object with filter capabilities

Hi,
I want a Customer object, the customer has a Address object which is not a relation. only the specific customer has this address. same with phone numbers, websites and so.

I would like to map my java NodeEntity to save Address Object as embedded.
Like MongoDB, with search by embedded field

Possible?
How?
if not, what can be a good solution without having another database?

Thanks

1 ACCEPTED SOLUTION

There are a couple issues on github open for this. Here's one.

So the fate of this depends on both prioritization against the other features we want to implement, as well as on the decisions of the OpenCypher group.

You might consider opening a new issue/request for this on the OpenCypher github

View solution in original post

6 REPLIES 6

Neo4j doesn't currently have embedded objects. You can represent similar structure with separate nodes with relationships between them, like this:

(:Customer)-[:HAS_ADDRESS]->(:Address)
(:Customer)-[:HAS_PHONE_NUMBER]->(:PhoneNumber)

and so forth. For simpler types, like phone number and website, you could get away with just having properties on the :Customer itself. For multi-field objects, like possibly :Address, a separate node may make more sense.

Your lookup Cypher would be performing a match on indexed properties of an :Address node using a pattern that would include the customer, so it's one quick traversal after finding the address in question to get to the customer.

Thank you.
Are there any plans for such feature?

There is some interest in having richer support for nested maps and JSON-like properties, though we'll have to finish up our 4.0 work before determining the course for those.

Can you please open this as a feature request so we can track the progress?
Much appreciated!

There are a couple issues on github open for this. Here's one.

So the fate of this depends on both prioritization against the other features we want to implement, as well as on the decisions of the OpenCypher group.

You might consider opening a new issue/request for this on the OpenCypher github

I will. thank you for you time