@xano/developer-mcp 1.0.75 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (127) hide show
  1. package/README.md +104 -37
  2. package/dist/cli_docs/index.d.ts +13 -37
  3. package/dist/cli_docs/index.js +28 -39
  4. package/dist/cli_docs/topics/integration.js +1 -1
  5. package/dist/cli_docs/topics/workspace.js +1 -1
  6. package/dist/index.js +58 -55
  7. package/dist/lib.d.ts +3 -1
  8. package/dist/lib.js +1 -1
  9. package/dist/meta_api_docs/format.js +1 -1
  10. package/dist/meta_api_docs/index.d.ts +14 -42
  11. package/dist/meta_api_docs/index.js +34 -46
  12. package/dist/tools/cli_docs.d.ts +2 -3
  13. package/dist/tools/cli_docs.js +3 -5
  14. package/dist/tools/define_tool.d.ts +47 -0
  15. package/dist/tools/define_tool.js +36 -0
  16. package/dist/tools/index.d.ts +88 -221
  17. package/dist/tools/index.js +80 -109
  18. package/dist/tools/mcp_version.d.ts +4 -25
  19. package/dist/tools/mcp_version.js +12 -19
  20. package/dist/tools/meta_api_docs.d.ts +2 -3
  21. package/dist/tools/meta_api_docs.js +3 -5
  22. package/dist/tools/validate_xanoscript.d.ts +18 -65
  23. package/dist/tools/validate_xanoscript.js +56 -54
  24. package/dist/tools/xanoscript_docs.d.ts +25 -74
  25. package/dist/tools/xanoscript_docs.js +86 -83
  26. package/dist/xanoscript_docs/README.md +5 -5
  27. package/dist/xanoscript_docs/apis.md +2 -2
  28. package/dist/xanoscript_docs/database.md +1 -1
  29. package/dist/xanoscript_docs/essentials.md +6 -6
  30. package/dist/xanoscript_docs/functions.md +3 -3
  31. package/dist/xanoscript_docs/integrations.md +5 -5
  32. package/dist/xanoscript_docs/middleware.md +1 -1
  33. package/dist/xanoscript_docs/performance.md +4 -4
  34. package/dist/xanoscript_docs/realtime.md +2 -2
  35. package/dist/xanoscript_docs/security.md +1 -1
  36. package/dist/xanoscript_docs/survival.md +1 -1
  37. package/dist/xanoscript_docs/syntax/string-filters.md +1 -1
  38. package/dist/xanoscript_docs/syntax.md +9 -9
  39. package/dist/xanoscript_docs/tools.md +2 -2
  40. package/dist/xanoscript_docs/types.md +2 -2
  41. package/dist/xanoscript_docs/unit-testing.md +1 -1
  42. package/dist/xanoscript_docs/workflow-tests.md +1 -1
  43. package/dist/xanoscript_docs/working.md +4 -4
  44. package/package.json +5 -4
  45. package/dist/api_docs/format.d.ts +0 -5
  46. package/dist/api_docs/format.js +0 -171
  47. package/dist/api_docs/index.d.ts +0 -52
  48. package/dist/api_docs/index.js +0 -111
  49. package/dist/api_docs/topics/agent.d.ts +0 -2
  50. package/dist/api_docs/topics/agent.js +0 -142
  51. package/dist/api_docs/topics/api.d.ts +0 -2
  52. package/dist/api_docs/topics/api.js +0 -176
  53. package/dist/api_docs/topics/apigroup.d.ts +0 -2
  54. package/dist/api_docs/topics/apigroup.js +0 -124
  55. package/dist/api_docs/topics/authentication.d.ts +0 -2
  56. package/dist/api_docs/topics/authentication.js +0 -61
  57. package/dist/api_docs/topics/branch.d.ts +0 -2
  58. package/dist/api_docs/topics/branch.js +0 -73
  59. package/dist/api_docs/topics/file.d.ts +0 -2
  60. package/dist/api_docs/topics/file.js +0 -70
  61. package/dist/api_docs/topics/function.d.ts +0 -2
  62. package/dist/api_docs/topics/function.js +0 -164
  63. package/dist/api_docs/topics/history.d.ts +0 -2
  64. package/dist/api_docs/topics/history.js +0 -149
  65. package/dist/api_docs/topics/mcp_server.d.ts +0 -2
  66. package/dist/api_docs/topics/mcp_server.js +0 -139
  67. package/dist/api_docs/topics/middleware.d.ts +0 -2
  68. package/dist/api_docs/topics/middleware.js +0 -156
  69. package/dist/api_docs/topics/realtime.d.ts +0 -2
  70. package/dist/api_docs/topics/realtime.js +0 -112
  71. package/dist/api_docs/topics/start.d.ts +0 -2
  72. package/dist/api_docs/topics/start.js +0 -107
  73. package/dist/api_docs/topics/table.d.ts +0 -2
  74. package/dist/api_docs/topics/table.js +0 -195
  75. package/dist/api_docs/topics/task.d.ts +0 -2
  76. package/dist/api_docs/topics/task.js +0 -165
  77. package/dist/api_docs/topics/tool.d.ts +0 -2
  78. package/dist/api_docs/topics/tool.js +0 -150
  79. package/dist/api_docs/topics/workflows.d.ts +0 -2
  80. package/dist/api_docs/topics/workflows.js +0 -131
  81. package/dist/api_docs/topics/workspace.d.ts +0 -2
  82. package/dist/api_docs/topics/workspace.js +0 -153
  83. package/dist/api_docs/types.d.ts +0 -79
  84. package/dist/api_docs/types.js +0 -4
  85. package/dist/cli_docs/topics/run.d.ts +0 -2
  86. package/dist/cli_docs/topics/run.js +0 -248
  87. package/dist/meta_api_docs/format.test.d.ts +0 -1
  88. package/dist/meta_api_docs/format.test.js +0 -272
  89. package/dist/meta_api_docs/index.test.d.ts +0 -1
  90. package/dist/meta_api_docs/index.test.js +0 -128
  91. package/dist/meta_api_docs/types.test.d.ts +0 -1
  92. package/dist/meta_api_docs/types.test.js +0 -132
  93. package/dist/templates/init-workspace.d.ts +0 -10
  94. package/dist/templates/init-workspace.js +0 -278
  95. package/dist/templates/xanoscript-index.d.ts +0 -11
  96. package/dist/templates/xanoscript-index.js +0 -72
  97. package/dist/tools/index.test.d.ts +0 -1
  98. package/dist/tools/index.test.js +0 -179
  99. package/dist/tools/xanoscript_docs.test.d.ts +0 -1
  100. package/dist/tools/xanoscript_docs.test.js +0 -197
  101. package/dist/xanoscript.test.d.ts +0 -1
  102. package/dist/xanoscript.test.js +0 -421
  103. package/dist/xanoscript_docs/cheatsheet.md +0 -287
  104. package/dist/xanoscript_docs/ephemeral.md +0 -330
  105. package/dist/xanoscript_docs/quickstart.md +0 -692
  106. package/dist/xanoscript_docs/run.md +0 -196
  107. package/dist/xanoscript_docs/schema.md +0 -300
  108. package/dist/xanoscript_docs_auto/README.md +0 -119
  109. package/dist/xanoscript_docs_auto/agents.md +0 -446
  110. package/dist/xanoscript_docs_auto/apis.md +0 -517
  111. package/dist/xanoscript_docs_auto/control-flow.md +0 -543
  112. package/dist/xanoscript_docs_auto/database.md +0 -551
  113. package/dist/xanoscript_docs_auto/debugging.md +0 -527
  114. package/dist/xanoscript_docs_auto/filters.md +0 -464
  115. package/dist/xanoscript_docs_auto/functions.md +0 -431
  116. package/dist/xanoscript_docs_auto/integrations.md +0 -657
  117. package/dist/xanoscript_docs_auto/mcp-servers.md +0 -408
  118. package/dist/xanoscript_docs_auto/operators.md +0 -368
  119. package/dist/xanoscript_docs_auto/syntax.md +0 -287
  120. package/dist/xanoscript_docs_auto/tables.md +0 -447
  121. package/dist/xanoscript_docs_auto/tasks.md +0 -479
  122. package/dist/xanoscript_docs_auto/testing.md +0 -574
  123. package/dist/xanoscript_docs_auto/tools.md +0 -485
  124. package/dist/xanoscript_docs_auto/triggers.md +0 -595
  125. package/dist/xanoscript_docs_auto/types.md +0 -323
  126. package/dist/xanoscript_docs_auto/variables.md +0 -462
  127. package/dist/xanoscript_docs_auto/version.json +0 -5
@@ -1,464 +0,0 @@
1
- ---
2
- applyTo: "**/*.xs"
3
- ---
4
-
5
- # Filters Reference
6
-
7
- Complete reference for all pipe filters in XanoScript.
8
-
9
- ## Quick Reference
10
-
11
- | Category | Filters |
12
- |----------|---------|
13
- | String | `trim`, `lower`, `upper`, `strlen`, `substr`, `split`, `replace` |
14
- | Array | `first`, `last`, `count`, `map`, `filter`, `find`, `reduce` |
15
- | Object | `get`, `set`, `unset`, `has`, `keys`, `values`, `entries` |
16
- | Math | `add`, `subtract`, `floor`, `ceil`, `round`, `abs` |
17
- | Type | `to_int`, `to_text`, `is_null`, `is_array`, `is_object` |
18
- | Date | `format_timestamp`, `transform_timestamp`, `timestamp_year` |
19
- | Encoding | `json_encode`, `base64_encode`, `url_encode` |
20
- | Security | `md5`, `sha256`, `encrypt`, `decrypt` |
21
-
22
- ---
23
-
24
- ## String Filters
25
-
26
- ### Basic String Operations
27
-
28
- | Filter | Example | Result |
29
- |--------|---------|--------|
30
- | `trim` | `" hi "\|trim` | `"hi"` |
31
- | `ltrim` | `" hi"\|ltrim` | `"hi"` |
32
- | `rtrim` | `"hi "\|rtrim` | `"hi"` |
33
- | `to_lower` | `"Hello"\|to_lower` | `"hello"` |
34
- | `to_upper` | `"Hello"\|to_upper` | `"HELLO"` |
35
- | `capitalize` | `"hello world"\|capitalize` | `"Hello World"` |
36
- | `strlen` | `"hello"\|strlen` | `5` |
37
-
38
- ### Substring Operations
39
-
40
- | Filter | Example | Result |
41
- |--------|---------|--------|
42
- | `substr` | `"hello"\|substr:1:3` | `"ell"` |
43
- | `split` | `"a,b,c"\|split:","` | `["a","b","c"]` |
44
- | `replace` | `"hello"\|replace:"l":"x"` | `"hexxo"` |
45
- | `concat` | `"a"\|concat:"b":"-"` | `"a-b"` |
46
-
47
- ### String Checks
48
-
49
- | Filter | Example | Result |
50
- |--------|---------|--------|
51
- | `contains` | `"hello"\|contains:"ell"` | `true` |
52
- | `starts_with` | `"hello"\|starts_with:"he"` | `true` |
53
- | `ends_with` | `"hello"\|ends_with:"lo"` | `true` |
54
- | `icontains` | `"Hello"\|icontains:"ELL"` | `true` |
55
- | `istarts_with` | `"Hello"\|istarts_with:"HE"` | `true` |
56
- | `iends_with` | `"Hello"\|iends_with:"LO"` | `true` |
57
-
58
- ### Regex Operations
59
-
60
- ```xs
61
- // Check if matches
62
- "/pattern/"|regex_matches:"subject"
63
-
64
- // Get first match
65
- "/(\w+)/"|regex_get_first_match:"hello world" // "hello"
66
-
67
- // Get all matches
68
- "/\w+/"|regex_get_all_matches:"hello world" // ["hello", "world"]
69
-
70
- // Replace with regex
71
- "/\s+/"|regex_replace:"-":"hello world" // "hello-world"
72
- ```
73
-
74
- ### String Escaping
75
-
76
- | Filter | Description |
77
- |--------|-------------|
78
- | `addslashes` | Escape quotes and backslashes |
79
- | `escape` | HTML escape |
80
- | `text_escape` | Escape for text output |
81
- | `regex_quote` | Escape regex special characters |
82
-
83
- ---
84
-
85
- ## Array Filters
86
-
87
- ### Array Access
88
-
89
- | Filter | Example | Result |
90
- |--------|---------|--------|
91
- | `first` | `[1,2,3]\|first` | `1` |
92
- | `last` | `[1,2,3]\|last` | `3` |
93
- | `count` | `[1,2,3]\|count` | `3` |
94
- | `slice` | `[1,2,3,4]\|slice:1:2` | `[2,3]` |
95
-
96
- ### Array Modification
97
-
98
- | Filter | Example | Result |
99
- |--------|---------|--------|
100
- | `push` | `[1,2]\|push:3` | `[1,2,3]` |
101
- | `pop` | `[1,2,3]\|pop` | `3` |
102
- | `unshift` | `[1,2]\|unshift:0` | `[0,1,2]` |
103
- | `shift` | `[1,2,3]\|shift` | `1` |
104
- | `reverse` | `[1,2,3]\|reverse` | `[3,2,1]` |
105
- | `unique` | `[1,1,2,2]\|unique` | `[1,2]` |
106
- | `flatten` | `[[1,2],[3]]\|flatten` | `[1,2,3]` |
107
- | `shuffle` | `[1,2,3]\|shuffle` | Random order |
108
-
109
- ### Array Combining
110
-
111
- | Filter | Example | Result |
112
- |--------|---------|--------|
113
- | `merge` | `[1,2]\|merge:[3,4]` | `[1,2,3,4]` |
114
- | `diff` | `[1,2,3]\|diff:[2]` | `[1,3]` |
115
- | `intersect` | `[1,2,3]\|intersect:[2,3,4]` | `[2,3]` |
116
- | `join` | `["a","b"]\|join:","` | `"a,b"` |
117
-
118
- ### Functional Array Operations
119
-
120
- ```xs
121
- // Map - transform each element
122
- [1,2,3]|map:$$*2 // [2,4,6]
123
- [{v:1},{v:2}]|map:$$.v // [1,2]
124
-
125
- // Filter - keep matching elements
126
- [1,2,3,4]|filter:$$>2 // [3,4]
127
- [1,2,3,4]|filter:$$%2==0 // [2,4]
128
-
129
- // Find - first matching element
130
- [{id:1},{id:2}]|find:$$.id==2 // {id:2}
131
-
132
- // FindIndex - index of first match
133
- [{id:1},{id:2}]|findIndex:$$.id==2 // 1
134
-
135
- // Some - any element matches?
136
- [1,2,3]|some:$$>2 // true
137
-
138
- // Every - all elements match?
139
- [2,4,6]|every:$$%2==0 // true
140
-
141
- // Reduce - accumulate to single value
142
- [1,2,3,4]|reduce:$$+$result:0 // 10
143
- ```
144
-
145
- ### Array Grouping
146
-
147
- ```xs
148
- // Group by property
149
- [{g:"a",v:1},{g:"b",v:2},{g:"a",v:3}]|index_by:g
150
- // {"a":[{g:"a",v:1},{g:"a",v:3}],"b":[{g:"b",v:2}]}
151
-
152
- // Sort
153
- [{n:"z"},{n:"a"}]|sort:n:text:false // Ascending
154
- [{n:"z"},{n:"a"}]|sort:n:text:true // Descending
155
- ```
156
-
157
- ### Array Filtering by Type
158
-
159
- | Filter | Description |
160
- |--------|-------------|
161
- | `filter_empty` | Remove empty values |
162
- | `filter_empty_text` | Remove empty strings |
163
- | `filter_empty_array` | Remove empty arrays |
164
- | `filter_empty_object` | Remove empty objects |
165
- | `filter_null` | Remove null values |
166
- | `filter_zero` | Remove zero values |
167
- | `filter_false` | Remove false values |
168
-
169
- ---
170
-
171
- ## Object Filters
172
-
173
- ### Property Access
174
-
175
- | Filter | Example | Result |
176
- |--------|---------|--------|
177
- | `get` | `{a:1}\|get:"a"` | `1` |
178
- | `set` | `{a:1}\|set:"b":2` | `{a:1,b:2}` |
179
- | `unset` | `{a:1,b:2}\|unset:"b"` | `{a:1}` |
180
- | `has` | `{a:1}\|has:"a"` | `true` |
181
-
182
- ### Object Transformation
183
-
184
- | Filter | Example | Result |
185
- |--------|---------|--------|
186
- | `keys` | `{a:1,b:2}\|keys` | `["a","b"]` |
187
- | `values` | `{a:1,b:2}\|values` | `[1,2]` |
188
- | `entries` | `{a:1}\|entries` | `[{key:"a",value:1}]` |
189
- | `pick` | `{a:1,b:2,c:3}\|pick:["a","c"]` | `{a:1,c:3}` |
190
- | `unpick` | `{a:1,b:2,c:3}\|unpick:["b"]` | `{a:1,c:3}` |
191
-
192
- ### Conditional Set
193
-
194
- ```xs
195
- {a:1}|set_conditional:"b":2:true // {a:1,b:2} if condition true
196
- {a:1}|set_ifnotempty:"b":"val" // Set only if val not empty
197
- {a:1}|set_ifnotnull:"b":$var // Set only if $var not null
198
- ```
199
-
200
- ---
201
-
202
- ## Math Filters
203
-
204
- ### Basic Math
205
-
206
- | Filter | Example | Result |
207
- |--------|---------|--------|
208
- | `add` | `10\|add:5` | `15` |
209
- | `subtract` | `10\|subtract:3` | `7` |
210
- | `multiply` | `10\|multiply:2` | `20` |
211
- | `divide` | `10\|divide:2` | `5` |
212
- | `modulus` | `10\|modulus:3` | `1` |
213
-
214
- ### Rounding
215
-
216
- | Filter | Example | Result |
217
- |--------|---------|--------|
218
- | `floor` | `2.7\|floor` | `2` |
219
- | `ceil` | `2.3\|ceil` | `3` |
220
- | `round` | `2.567\|round:2` | `2.57` |
221
- | `abs` | `-5\|abs` | `5` |
222
-
223
- ### Advanced Math
224
-
225
- | Filter | Example | Result |
226
- |--------|---------|--------|
227
- | `sqrt` | `9\|sqrt` | `3` |
228
- | `pow` | `2\|pow:3` | `8` |
229
- | `min` | `5\|min:3` | `3` |
230
- | `max` | `5\|max:10` | `10` |
231
-
232
- ### Array Math
233
-
234
- ```xs
235
- [1,2,3,4]|sum // 10
236
- [1,2,3,4]|avg // 2.5
237
- [1,2,3,4]|product // 24
238
- [5,2,8,1]|array_min // 1
239
- [5,2,8,1]|array_max // 8
240
- ```
241
-
242
- ### Trigonometry
243
-
244
- `sin`, `cos`, `tan`, `asin`, `acos`, `atan`, `deg2rad`, `rad2deg`, `sinh`, `cosh`, `tanh`
245
-
246
- ---
247
-
248
- ## Type Filters
249
-
250
- ### Type Conversion
251
-
252
- | Filter | Example | Result |
253
- |--------|---------|--------|
254
- | `to_int` | `"123"\|to_int` | `123` |
255
- | `to_decimal` | `"1.5"\|to_decimal` | `1.5` |
256
- | `to_text` | `123\|to_text` | `"123"` |
257
- | `to_bool` | `"true"\|to_bool` | `true` |
258
-
259
- ### Type Checking
260
-
261
- | Filter | Example | Result |
262
- |--------|---------|--------|
263
- | `is_null` | `null\|is_null` | `true` |
264
- | `is_empty` | `[]\|is_empty` | `true` |
265
- | `is_array` | `[1]\|is_array` | `true` |
266
- | `is_object` | `{}\|is_object` | `true` |
267
- | `is_int` | `1\|is_int` | `true` |
268
- | `is_text` | `"a"\|is_text` | `true` |
269
- | `is_decimal` | `1.5\|is_decimal` | `true` |
270
- | `is_bool` | `true\|is_bool` | `true` |
271
-
272
- ### Null Handling
273
-
274
- ```xs
275
- null|first_notnull:0 // 0
276
- ""|first_notempty:"default" // "default"
277
- ```
278
-
279
- ---
280
-
281
- ## Date/Time Filters
282
-
283
- ### Timestamp Parsing
284
-
285
- | Filter | Example | Description |
286
- |--------|---------|-------------|
287
- | `to_timestamp` | `"now"\|to_timestamp` | Parse to timestamp |
288
- | `to_ms` | `"now"\|to_ms` | Milliseconds since epoch |
289
- | `to_seconds` | `"now"\|to_seconds` | Seconds since epoch |
290
-
291
- ### Timestamp Formatting
292
-
293
- ```xs
294
- $ts|format_timestamp:"Y-m-d":"UTC"
295
- $ts|format_timestamp:"Y-m-d H:i:s":"America/New_York"
296
- $ts|format_timestamp:"F j, Y":"UTC" // "January 15, 2025"
297
- ```
298
-
299
- ### Timestamp Manipulation
300
-
301
- ```xs
302
- $ts|transform_timestamp:"-7 days"
303
- $ts|transform_timestamp:"+1 month"
304
- $ts|transform_timestamp:"+2 hours"
305
- $ts|add_secs_to_timestamp:3600 // Add 1 hour
306
- $ts|add_ms_to_timestamp:1000 // Add 1 second
307
- ```
308
-
309
- ### Timestamp Parts
310
-
311
- | Filter | Returns |
312
- |--------|---------|
313
- | `timestamp_year` | Year (e.g., 2025) |
314
- | `timestamp_month` | Month (1-12) |
315
- | `timestamp_day_of_month` | Day (1-31) |
316
- | `timestamp_hour` | Hour (0-23) |
317
- | `timestamp_minute` | Minute (0-59) |
318
- | `timestamp_day_of_week` | Day (0=Sunday) |
319
- | `timestamp_week` | Week number |
320
- | `timestamp_day_of_year` | Day of year (1-366) |
321
-
322
- ---
323
-
324
- ## Encoding Filters
325
-
326
- ### JSON
327
-
328
- ```xs
329
- {a:1}|json_encode // '{"a":1}'
330
- '{"a":1}'|json_decode // {a:1}
331
- ```
332
-
333
- ### Base64
334
-
335
- ```xs
336
- "hello"|base64_encode // "aGVsbG8="
337
- "aGVsbG8="|base64_decode // "hello"
338
- ```
339
-
340
- ### URL
341
-
342
- ```xs
343
- "hello world"|url_encode // "hello%20world"
344
- "hello%20world"|url_decode // "hello world"
345
- ```
346
-
347
- ### Other
348
-
349
- | Filter | Description |
350
- |--------|-------------|
351
- | `xml_decode` | Parse XML to object |
352
- | `yaml_encode` | Object to YAML |
353
- | `yaml_decode` | YAML to object |
354
- | `hex2bin` | Hex string to binary |
355
- | `bin2hex` | Binary to hex string |
356
- | `csv_parse` | Parse CSV string |
357
- | `csv_create` | Create CSV string |
358
- | `querystring_parse` | Parse query string |
359
-
360
- ---
361
-
362
- ## Security Filters
363
-
364
- ### Hashing
365
-
366
- | Filter | Description |
367
- |--------|-------------|
368
- | `md5` | MD5 hash |
369
- | `sha1` | SHA-1 hash |
370
- | `sha256` | SHA-256 hash |
371
- | `sha512` | SHA-512 hash |
372
- | `hmac_sha256` | HMAC-SHA256 |
373
-
374
- ### Encryption
375
-
376
- ```xs
377
- "data"|encrypt:"aes-256-cbc":"key":"iv"
378
- $encrypted|decrypt:"aes-256-cbc":"key":"iv"
379
- ```
380
-
381
- ### JWT
382
-
383
- ```xs
384
- $payload|jws_encode:"HS256":"secret" // Sign
385
- $token|jws_decode:"secret" // Verify and decode
386
-
387
- $payload|jwe_encode:"A256GCM":"key" // Encrypt
388
- $token|jwe_decode:"key" // Decrypt
389
- ```
390
-
391
- ### ID Obfuscation
392
-
393
- ```xs
394
- 123|secureid_encode // Obfuscated ID
395
- "obfuscated"|secureid_decode // Original ID
396
- ```
397
-
398
- ### UUID Generation
399
-
400
- ```xs
401
- |uuid // Generate UUID
402
- ```
403
-
404
- ---
405
-
406
- ## Database Query Filters
407
-
408
- Special filters for `db.query` where clauses:
409
-
410
- ### String Operations
411
-
412
- ```xs
413
- $db.user.name|to_lower == $input.name|to_lower
414
- $db.product.sku|substr:0:3 == "SKU"
415
- $db.name|unaccent ilike $input.search
416
- ```
417
-
418
- ### Array Operations
419
-
420
- ```xs
421
- $db.tags|contains:"featured"
422
- $db.categories|overlaps:["a","b"]
423
- $db.items|length >= 3
424
- ```
425
-
426
- ### Vector Operations (AI/ML)
427
-
428
- ```xs
429
- $db.embedding|cosine_similarity:$vec
430
- $db.embedding|l2_distance_euclidean:$vec
431
- $db.embedding|inner_product:$vec
432
- $db.embedding|l1_distance_manhattan:$vec
433
- ```
434
-
435
- ### Geo Operations
436
-
437
- ```xs
438
- $db.location|distance:$point // Distance in meters
439
- $db.location|within:$point:5000 // Within 5km
440
- $db.boundary|covers:$point // Polygon contains point
441
- ```
442
-
443
- ### Timestamp Arithmetic
444
-
445
- ```xs
446
- $db.created_at|timestamp_add_days:7
447
- $db.expires_at|timestamp_subtract_hours:24
448
- ```
449
-
450
- ---
451
-
452
- ## Chaining Filters
453
-
454
- Combine multiple filters:
455
-
456
- ```xs
457
- $input.email|trim|to_lower
458
-
459
- $input.text|trim|substr:0:100|replace:" ":"-"|to_lower
460
-
461
- $array|filter:$$.active|map:$$.name|join:", "
462
-
463
- $data|json_encode|base64_encode
464
- ```