Get
| Information | |
|---|---|
| Type | Data Function |
| Namespace | moxlib:api/data/get |
| Versions | 1.15+ |
Overview
Retrieves the first Object in target to successfully Compare with key.
Example
In this example, key is set to {id:2}. As such, it returns {id:2,b:1} to output.
data modify storage moxlib:api/data/get target set value [{id:1,a:1},{id:2,b:1},{id:3,c:1}]
data modify storage moxlib:api/data/get key set value {id:2}
function moxlib:api/data/get
Output of storage moxlib:api/data/get
{
output: {id:2,b:1},
success: true
}
API
Expects:
- Object Array
target - Object
key
Returns
- Object
output
The first Object to Compare with key, if any.
- Boolean
success
If an object could be found, true. Otherwise, false.