Compare
| Information | |
|---|---|
| Type | Data Function |
| Namespace | moxlib:api/data/compare |
| Versions | 1.15+ |
Overview
Returns an output of true if target contains all of the same key/value pairings as key.
Example
In this example, key is set to {id:1b}, which is also contained in target. As such,
output returns true.
data modify storage moxlib:api/data/compare target set value {id:1b,data:"Hello"}
data modify storage moxlib:api/data/compare key set value {id:1b}
function moxlib:api/data/compare
Output of storage moxlib:api/data/compare
{
output: true,
success: true
}
API
Expects
Returns
- Boolean
output
If target contains key, true. Otherwise, false.
- Boolean
success
If Comparison ran successfully, true. Otherwise, false.