-
Notifications
You must be signed in to change notification settings - Fork 2
MatchingExample
Glythcing edited this page Sep 17, 2018
·
2 revisions
The following example shows the use of the exists
entry point to determine whether the predicates match the input.
[
{
"name": "tap",
"price": 49.99,
"quantity": 10,
"active": true,
"owner": null,
"since": "2018-09-07"
},
{
"name": "sink",
"price": 99.99,
"quantity": 100,
"active": false,
"owner": null,
"since": "2018-09-02"
}
]
Tranquil.parse(json).exists("quantity = 10 and name like 'ta' and owner is null")
Tranquil will return: true
Tranquil.parse(json).exists("quantity > 10")
Tranquil will return: false