Can't put more data into second level embedded map

46 views
Skip to first unread message

boro...@gmail.com

unread,
Oct 10, 2016, 3:38:46 PM10/10/16
to OrientDB
Hello,

I'm sure I'm missing something, but I just can't figure it out from the online docs. I have a Class "Account", inside it has Embedded class "AccountSettings", which has another embeddedmap  "classTemplate". I'm trying to add values to the embedded map "classTemplate", but the "put" method fails on me. Please see below:

// Account
create class Account extends V
create property Account.settings EMBEDDED AccountSettings

// Account Settings
create class AccountSettings extends V
create property AccountSettings.classTemplate EMBEDDEDMAP String

I created a record in the Account class, then I did the following:

// Simply initialized "settings" in the Account to an AccountSettings class
update Account set settings = {"@type":"d", "@class":"AccountSettings"} where @rid = #25:0

// add class template
update #25:0 set settings.classTemplate = {'template1':'aaa'}   << this one works to initially create the map
update #25:0 put settings.classTemplate = 'template2', 'bbb'    << this one fails!

Error: com.orientechnologies.orient.core.sql.OCommandSQLParsingException: Error parsing query:

update #25:0 put settings.classTemplate = 'template2', 'bbb'


Is there a different/better way to put map elements into the embedded map when it is part of another embedded class? 

p.s. I'm running orientdb 2.2.10

Ivan Mainetti

unread,
Oct 10, 2016, 4:44:11 PM10/10/16
to OrientDB
seems like a bug to me

Luigi Dell'Aquila

unread,
Oct 11, 2016, 4:00:19 AM10/11/16
to orient-...@googlegroups.com
Hi,

It seems there is a bug in the parser, but to be honest I really hate that syntax, it's not clear, not elegant and IMHO also misleading.
You can try this:

update #25:0 set settings.classTemplate.template2 = 'bbb'

it has the exact same semantics, but it's clear and straight forward.

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.

boro...@gmail.com

unread,
Oct 11, 2016, 1:37:23 PM10/11/16
to OrientDB
You're right, it works and I'll use it that way for now. However, should I submit it as a bug orientDB team or is it something you working on to change in 3.0?

To unsubscribe from this group and stop receiving emails from it, send an email to orient-databa...@googlegroups.com.

Luigi Dell'Aquila

unread,
Oct 12, 2016, 3:38:24 AM10/12/16
to orient-...@googlegroups.com
Hi,

please submit it as a bug, 2.2.x is latest stable branch and it's a supported feature, so it's supposed to be fixed.
In 3.0 probably it will be deprecated

Thanks

Luigi


To unsubscribe from this group and stop receiving emails from it, send an email to orient-database+unsubscribe@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages