-
Notifications
You must be signed in to change notification settings - Fork 2
SimpleExample
Glythcing edited this page Sep 17, 2018
·
3 revisions
The following example shows the use of:
- Predicates to match a single document in a JSON array
- Projections to read a subset of the attributes in the matched document
[
{
"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).read(
"name, price, quantity",
"quantity = 10 and name like 'ta' and owner is null"
)
Tranquil will return:
{
"name": "tap",
"price": 49.99,
"quantity": 10
}
Follow the links in the sidebar for more complex examples exploring the full Tranquil feature set.