Neo4j node property containing raw json as metadata

Is it possible to have the node property as a json raw string and filter it with cypher? I have a node with some specific properties and metadata (json raw string). I would like to select or filter this metadata property. This is something like this:

START movie=node:TYPE_INDEX(Type = 'MOVIE') // Start with the reference MATCH movie-[t:TAG]->tag WHERE collect(movie.Metadata).RatingPress > 3 RETURN distinct movie.Label 

And the metadata looks something like this:

 {"RatingPress" : "0","RatingSpectator" : 3"} 

I expected to use the collect function to call the property as follows:

 collect(movie.Metadata).RatingPress 

But of course this fails ...

Is this a way to bind some json string from node property using cypher?

thanks for the help

+4
source share
2 answers

This is contrary to the principles of properties. Why not set properties in JSON metadata directly on node?

But to answer your question:

No, cypher does not know about JSON.

+4
source

We view all Node as blob JSON. Since Neo4j does not support hierarchical properties, we smooth out JSON in the names of restricted properties when saving and unflatten them when reading. Then you can generate Cypher requests for (for example) the property name "foo.bar.baz". Queries tend to look a little scared because you will need to quote them using single quotes, but it works.

+4
source