Note that I also tried this (which also fails in the same way):

UPDATE #14:1 PUT Options = '22', {"Action":"Test22a","Enabled":false, 
"@type":"d", "@class":"VOptions"} WHERE NOT (Options CONTAINSKEY '22') 
RETURN AFTER @this.Options['22']

But this works:

UPDATE #14:1 SET OtherProperty = 'OtherValue' RETURN AFTER 
@this.Options['22']

Is it possible that the RETURN clause can't be used with a PUT operation?


On Wednesday, June 1, 2016 at 7:46:53 AM UTC-5, Eric24 wrote:
>
> I'm running 2.2 GA. My attempt at doing this was various versions of this 
> (but I haven't found any combination that works):
>
> UPDATE #14:1 PUT Options = '22', {"Action":"Test22a","Enabled":false, 
> "@type":"d", "@class":"VOptions"} WHERE NOT (Options CONTAINSKEY '22') 
> RETURN AFTER Options['22']
>
> It works up to the RETURN (i.e. if I omit this last part, the first part 
> does indeed allow me to "blindly" do the PUT and only actually modify the 
> record if the key doesn't exist). The idea was to get the new embedded 
> record (or link) back after the update or return the value with the 
> matching key that was already there, and do this as an atomic operation.
>
>
> On Wednesday, June 1, 2016 at 12:06:42 AM UTC-5, [email protected] 
> wrote:
>>
>> Hi Eric,
>>
>> Can you post your query?
>> Which version are you using?
>>
>> Regards,
>> Michela
>>
>

-- 

--- 
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 [email protected].
For more options, visit https://groups.google.com/d/optout.

Reply via email to