1import { ApifyClient } from 'apify-client';
2
3
4
5const client = new ApifyClient({
6 token: '<YOUR_API_TOKEN>',
7});
8
9
10const input = {
11 "items": [
12 {
13 "name": "Alice",
14 "age": 31,
15 "active": true
16 },
17 {
18 "name": "Bob",
19 "age": 19,
20 "active": false
21 }
22 ],
23 "conditions": [
24 {
25 "field": "age",
26 "operator": "gte",
27 "value": 21
28 },
29 {
30 "field": "active",
31 "operator": "equals",
32 "value": true
33 }
34 ]
35};
36
37
38const run = await client.actor("urban_souffle/mf-232-json-record-filter").call(input);
39
40
41console.log('Results from dataset');
42console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
43const { items } = await client.dataset(run.defaultDatasetId).listItems();
44items.forEach((item) => {
45 console.dir(item);
46});
47
48