I tried to reproduce it and I cannot. It worked (without return null 
values) in OrientDb 2.1.3. But OrientDb 2.1.15 return NO activities at all.

Any suggestion to change my schema or SQL so I can get the answers I am 
looking for are welcome. Luca asked me if I was using explicit list or 
maps. I am using SQL with a JSON Property. No sure how OrientDb Store a 
property with a map of objects expressed in JSON.

Here is the SQL I used:

CREATE CLASS User EXTENDS V
create property User.userId integer
create index User.userId unique
UPDATE User SET userId = 23232 , activities = [{"data": "Buenos Aires", 
"type": "excursion", "day": 0}, {"data": "Delta Tigre", "type": "picnic", 
"day": 1}] UPSERT RETURN AFTER @rid WHERE userId = 23232
UPDATE User SET userId = 23233 , activities = [{"data": "Milan", "type": 
"excursion", "day": 0}] UPSERT RETURN AFTER @rid WHERE userId = 23233
UPDATE User SET userId = 23234 , activities = [{"data": "Paris", "type": 
"picnic", "day": 3}] UPSERT RETURN AFTER @rid WHERE userId = 23234
UPDATE User SET userId = 23235 , activities = [{"data": "New York", "type": 
"excursion", "day": 0}] UPSERT RETURN AFTER @rid WHERE userId = 23245

I used upsert because I am importing data from other place and the import 
process can run several times.

Now the queries:

SELECT FROM User 
(returns data as expected)

<https://lh3.googleusercontent.com/-hWWw62sesXQ/Vxa9NtTAPEI/AAAAAAAAEV8/gYGOIfYNMcEZulrFa2aeOeK7aYDn4bgXACLcB/s1600/Screenshot%2Bfrom%2B2016-04-19%2B16%253A05%253A46.png>



SELECT userId, activities[type='excursion'].data as excursion, 
activities[type='picnic'].data as picnic
FROM User
UNWIND excursion, picnic
(returns userId, and empty information in OrientDb 2.1.15).

<https://lh3.googleusercontent.com/-qJi2Cy5u-AM/Vxa9VNV5nII/AAAAAAAAEWA/bUPty4I5uBsYuZAPI8Snx9q-ANlvwvDHACLcB/s1600/Screenshot%2Bfrom%2B2016-04-19%2B16%253A07%253A55.png>




Pablo



On Tuesday, April 19, 2016 at 3:12:06 AM UTC-7, [email protected] wrote:
>
> Hi Pabloa,
> I tried with 2.1.15 with the following records
>
>
> <https://lh3.googleusercontent.com/-JxffxJVp8rQ/VxYELxznmZI/AAAAAAAAANM/kXOfnB2xEEAssrRPmEAkZi_8WhAyv1-4gCLcB/s1600/1.png>
>
> I got these results
>
>
> <https://lh3.googleusercontent.com/-hYN3BPWeUVk/VxYEYFjMoRI/AAAAAAAAANQ/rVWMDZ05nNQZ7lA-rGgnxuxfLIz8Dr7jACLcB/s1600/2.png>
>
> Kind regards,
> Alessandro
>
>
>
>

-- 

--- 
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