Torstein
Posts: 0
Joined: Mon Sep 29, 2014 7:00 pm

Get one element from array without using list element

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

Maryna Brodina
Posts: 0
Joined: Thu Apr 05, 2012 7:27 am

Get one element from array without using list element

Hello!

Please delete link between $-Text

Torstein
Posts: 0
Joined: Mon Sep 29, 2014 7:00 pm

Get one element from array without using list element

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

Return to “Issues”