Using a schema with class person:
class person
property 'name', type string
property 'phone', type embeddedmap, link-type string
I add the following records:
person@name:"Jack",phone:
{"home":"
201-555-1000","cell":"
201-555-1001","work":"
201-555-1002"}
person@name:"Jill",phone:
{"home":"
201-556-1000","cell":"
201-556-1001","work":"
201-555-1002"}
person@name:"Mary",phone:
{"home":"
201-556-1000","cell":"
201-557-1001","work":"
201-555-1002"}
I'd like to do a few types of select, and am unsure of the correct
syntax.
1) A select based on lookups in the map
select from person where phone["home"] = "
201-556-1000"
I've tried select from person where phone containsvalue ( home =
"
201-556-1000" ) , but I get:
Error: Error on loading record #5:0. Cause:
java.lang.ClassCastException: java.lang.String cannot be cast to
com.orientechnologies.orient.core.record.ORecordSchemaAware
Error: java.lang.String cannot be cast to
com.orientechnologies.orient.core.record.ORecordSchemaAware
2) A select using a projection inside the map
select phone["home"] from person
The only example I find like this that works is using an embeddedmap
of embedded, but
even in that example, the map key is not used for the select.
Thanks,
Steve