Behavior of elements in EMBEDDEDLIST

39 views
Skip to first unread message

Eric24

unread,
Oct 25, 2017, 10:37:50 PM10/25/17
to OrientDB
Using ODB 2.2.28, I have a simple Class that contains an EMBEDDEDLIST called "data". If I update "data" like this:
UPDATE #12:4 SET data = [{"a":111}, {"b":222}, [{"c":555}, {"d":777}]]

The result of then selecting "data" from the record is this:
[{"@type":"d","@version":0,"a":111},{"@type":"d","@version":0,"b":222},[{"c":555},{"d":777}]]

As you can see, "data" contains three elements, as expected, but why do the two elements that are standalone objects get @type and @version properties, while the element that is an array of objects element does not? And more specifically, I would prefer to avoid the standalone objects from being treated in this way.

Luigi Dell'Aquila

unread,
Oct 26, 2017, 9:25:55 AM10/26/17
to orient-...@googlegroups.com
Hi Eric,

Try to define the property as EMBEDDEDMAP with LINKEDTYPE = EMBEDDEDMAP, it should solve the problem

Thanks

Luigi

--

---
You received this message because you are subscribed to the Google Groups "OrientDB" group.
To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

Eric Lenington

unread,
Oct 26, 2017, 9:27:17 AM10/26/17
to OrientDB
Thanks for the quick response. I'm not familiar with that option. What's the syntax of the create property statement to do this?

--

---
You received this message because you are subscribed to a topic in the Google Groups "OrientDB" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/orient-database/Eo3cdN-DlMM/unsubscribe.
To unsubscribe from this group and all its topics, send an email to orient-database+unsubscribe@googlegroups.com.

Luigi Dell'Aquila

unread,
Oct 26, 2017, 9:42:03 AM10/26/17
to orient-...@googlegroups.com
Hi Eric,

The syntax is following

CREATE PROPERTY ClassName.propertyName EMBEDDEDLIST EMBEDDEDMAP

but I see that in your list you have a mix of maps and sublists, so I'm afraid it won't work...

Luigi

Eric24

unread,
Oct 27, 2017, 9:42:42 AM10/27/17
to OrientDB
So is there a solution?
Reply all
Reply to author
Forward
0 new messages