Node with object as properties

9 views
Skip to first unread message

bishal...@javra.com

unread,
Oct 20, 2016, 11:12:36 AM10/20/16
to Neo4j
I have a huge database that is around 1.5 million count of a single table and there are many tables. What I have to do is apply filter and sort stuffs. So, I modeled the graph database and still the sorting takes kinda 9 seconds because of eager aggregation, matching etc. So, what I want to do is store relevant objects into node properties for faster sorting. So, how can I achieve that.

match (b:Batch)-[:OBSERVATION_OF]->(obs) 

with obs,b 

match (obs)-[r:OF_CHAR_TYPE|:OF_INT_TYPE]-(obsType) 

with distinct(obs.EZID) as EZID, {Observation:collect({TraitID:obs.TraitID, value:obsType.ObsValue})} as Observations 

create (n:NEW{EZID:EZID,Observation:Observations}) //But this isn't allowed 

I receive an error of "WARNING: Collections containing mixed types can not be stored in properties."

And, when I try this:

match (b:Batch)-[:OBSERVATION_OF]->(obs) 

with obs,b 

match (obs)-[r:OF_CHAR_TYPE|:OF_INT_TYPE]-(obsType) 

with distinct(obs.EZID) as EZID, {Observation:collect({TraitID:obs.TraitID, value:obsType.ObsValue})} as Observations 

create (n:NEW{EZID:EZID,TraitID:Observations.TraitID,Value:Observations.value}) 

I get an error "WARNING: Type mismatch: expected Any, Map, Node or Relationship but was Collection<Map>".

Please suggest me how to workaround this problem!

Reply all
Reply to author
Forward
0 new messages