Page 1 of 1

Get one element from array without using list element

Posted: Thu Nov 13, 2014 7:55 am
by Torstein

After figuring out the use of "Pointer" to an Object in Appery, I got my query to work between two DB's. Now I've got the trouble of getting one item from the array.

How do I use mapping so I just get one item from the array? Without using a list element that loops through the array?

It's probably something simple like return value[0]; in custom JS, but I can't figure it out. Where to put the $ in mapping for example?

Some images attached to show the field I want to populate with one value from the query based on _id to the element. Should just return one element.
Image

Another image to show the before query that I know works. It's spitting out e.g this: {"_id":"53b5dc37e4b09f5c7d5014c7"} in the where field.
Image


Get one element from array without using list element

Posted: Thu Nov 13, 2014 9:20 am
by Maryna Brodina

Hello!

Please delete link between $-Text


Get one element from array without using list element

Posted: Sun Nov 16, 2014 10:07 pm
by Torstein

Thanks! I think I just was wrong with my thinking on this one.