How can I complete this query? arrays inside arrays

28 views
Skip to first unread message

Academia Learning Centro de inglés y de formación

unread,
Dec 5, 2016, 5:08:03 AM12/5/16
to orient-...@googlegroups.com
Hello guys I have an element with a json value and inside it has several arrays inside arrays.

I want to retrieve the values of the field Temperature only of the arrays that are of the temperature type. 

But this query returns all the values with only one of the arrays is of type Temperature.

select value.content.data.events.data.items.value.magnitude
from CompositionVersions
where 'Temperature' in value.content.data.events.data.items.name.value


Pdcontent, evetns, items are arrays 

Thanks

Academia Learning Centro de inglés y de formación

unread,
Dec 5, 2016, 8:53:09 AM12/5/16
to OrientDB
So if it works to me (add [0]) but how could I know in which position is the array is the temperature field, or how else could I get it?

select value.content.data.events.data.items.value.magnitude[0]
from CompositionVersions
where 'Temperature' in value.content.data.events.data.items.name.value
Thanks

cycch...@gmail.com

unread,
Jan 25, 2017, 3:30:21 PM1/25/17
to OrientDB
Hi , friend, I got a same problem as yours, I also want to find the item position in a array. How do you solve it ?

Regards 
Reply all
Reply to author
Forward
0 new messages