@mongodb-js/mongodb-constants 0.1.1

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 (48) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +3 -0
  3. package/dist/.esm-wrapper.mjs +25 -0
  4. package/dist/accumulators.d.ts +226 -0
  5. package/dist/accumulators.d.ts.map +1 -0
  6. package/dist/accumulators.js +261 -0
  7. package/dist/accumulators.js.map +1 -0
  8. package/dist/bson-type-aliases.d.ts +155 -0
  9. package/dist/bson-type-aliases.d.ts.map +1 -0
  10. package/dist/bson-type-aliases.js +178 -0
  11. package/dist/bson-type-aliases.js.map +1 -0
  12. package/dist/bson-types.d.ts +123 -0
  13. package/dist/bson-types.d.ts.map +1 -0
  14. package/dist/bson-types.js +139 -0
  15. package/dist/bson-types.js.map +1 -0
  16. package/dist/conversion-operators.d.ts +87 -0
  17. package/dist/conversion-operators.d.ts.map +1 -0
  18. package/dist/conversion-operators.js +103 -0
  19. package/dist/conversion-operators.js.map +1 -0
  20. package/dist/env.d.ts +6 -0
  21. package/dist/env.d.ts.map +1 -0
  22. package/dist/env.js +12 -0
  23. package/dist/env.js.map +1 -0
  24. package/dist/expression-operators.d.ts +740 -0
  25. package/dist/expression-operators.d.ts.map +1 -0
  26. package/dist/expression-operators.js +849 -0
  27. package/dist/expression-operators.js.map +1 -0
  28. package/dist/index.d.ts +11 -0
  29. package/dist/index.d.ts.map +1 -0
  30. package/dist/index.js +27 -0
  31. package/dist/index.js.map +1 -0
  32. package/dist/json-schema.d.ts +264 -0
  33. package/dist/json-schema.d.ts.map +1 -0
  34. package/dist/json-schema.js +297 -0
  35. package/dist/json-schema.js.map +1 -0
  36. package/dist/ns.d.ts +8 -0
  37. package/dist/ns.d.ts.map +1 -0
  38. package/dist/ns.js +16 -0
  39. package/dist/ns.js.map +1 -0
  40. package/dist/query-operators.d.ts +234 -0
  41. package/dist/query-operators.d.ts.map +1 -0
  42. package/dist/query-operators.js +271 -0
  43. package/dist/query-operators.js.map +1 -0
  44. package/dist/stage-operators.d.ts +711 -0
  45. package/dist/stage-operators.d.ts.map +1 -0
  46. package/dist/stage-operators.js +967 -0
  47. package/dist/stage-operators.js.map +1 -0
  48. package/package.json +67 -0
@@ -0,0 +1,967 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.REQUIRED_AS_FIRST_STAGE = exports.FULL_SCAN_STAGES = exports.OUT_STAGES = exports.STAGE_OPERATOR_NAMES = exports.STAGE_OPERATORS = void 0;
4
+ const env_1 = require("./env");
5
+ const ns_1 = require("./ns");
6
+ const STAGE_OPERATORS = [
7
+ {
8
+ name: '$addFields',
9
+ value: '$addFields',
10
+ label: '$addFields',
11
+ outputStage: false,
12
+ fullScan: false,
13
+ firstStage: false,
14
+ score: 1,
15
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
16
+ meta: 'stage',
17
+ version: '3.4.0',
18
+ apiVersions: [1],
19
+ namespaces: [...ns_1.ANY_NAMESPACE],
20
+ description: 'Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value.',
21
+ comment: `/**
22
+ * newField: The new field name.
23
+ * expression: The new field expression.
24
+ */
25
+ `,
26
+ snippet: `{
27
+ \${1:newField}: \${2:expression}, \${3:...}
28
+ }`,
29
+ },
30
+ {
31
+ name: '$bucket',
32
+ value: '$bucket',
33
+ label: '$bucket',
34
+ outputStage: false,
35
+ fullScan: true,
36
+ firstStage: false,
37
+ score: 1,
38
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
39
+ meta: 'stage',
40
+ version: '3.4.0',
41
+ apiVersions: [1],
42
+ namespaces: [...ns_1.ANY_NAMESPACE],
43
+ description: 'Categorizes incoming documents into groups, called buckets, based on specified boundaries.',
44
+ comment: `/**
45
+ * groupBy: The expression to group by.
46
+ * boundaries: An array of the lower boundaries for each bucket.
47
+ * default: The bucket name for documents that do not fall within the specified boundaries
48
+ * output: {
49
+ * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.
50
+ * }
51
+ */
52
+ `,
53
+ snippet: `{
54
+ groupBy: \${1:expression},
55
+ boundaries: [ \${2:lowerbound}, \${3:...} ],
56
+ default: \${4:literal},
57
+ output: {
58
+ \${5:outputN}: { \${6:accumulator} }, \${7:...}
59
+ }
60
+ }`,
61
+ },
62
+ {
63
+ name: '$bucketAuto',
64
+ value: '$bucketAuto',
65
+ label: '$bucketAuto',
66
+ outputStage: false,
67
+ fullScan: true,
68
+ firstStage: false,
69
+ score: 1,
70
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
71
+ meta: 'stage',
72
+ version: '3.4.0',
73
+ apiVersions: [1],
74
+ namespaces: [...ns_1.ANY_NAMESPACE],
75
+ description: 'Automatically categorizes documents into a specified number of buckets, attempting even distribution if possible.',
76
+ comment: `/**
77
+ * groupBy: The expression to group by.
78
+ * buckets: The desired number of buckets
79
+ * output: {
80
+ * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.
81
+ * }
82
+ * granularity: Optional number series
83
+ */
84
+ `,
85
+ snippet: `{
86
+ groupBy: \${1:expression},
87
+ buckets: \${2:number},
88
+ output: {
89
+ \${3:outputN}: \${4:accumulator}, \${5:...}
90
+ },
91
+ granularity: '\${6:string}'
92
+ }`,
93
+ },
94
+ {
95
+ name: '$collStats',
96
+ value: '$collStats',
97
+ label: '$collStats',
98
+ outputStage: false,
99
+ fullScan: false,
100
+ firstStage: true,
101
+ score: 1,
102
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
103
+ meta: 'stage',
104
+ version: '3.4.0',
105
+ apiVersions: [],
106
+ namespaces: [...ns_1.ANY_COLLECTION_NAMESPACE],
107
+ description: 'Returns statistics regarding a collection or view.',
108
+ comment: `/**
109
+ * histograms: Optional latency histograms.
110
+ * storageStats: Optional storage stats.
111
+ */
112
+ `,
113
+ snippet: `{
114
+ latencyStats: {
115
+ histograms: \${1:boolean}
116
+ },
117
+ storageStats: {\${2:}},
118
+ }`,
119
+ },
120
+ {
121
+ name: '$count',
122
+ value: '$count',
123
+ label: '$count',
124
+ outputStage: false,
125
+ fullScan: false,
126
+ firstStage: false,
127
+ score: 1,
128
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
129
+ meta: 'stage',
130
+ version: '2.2.0',
131
+ apiVersions: [1],
132
+ namespaces: [...ns_1.ANY_NAMESPACE],
133
+ description: 'Returns a count of the number of documents at this stage of the aggregation pipeline.',
134
+ comment: `/**
135
+ * Provide the field name for the count.
136
+ */
137
+ `,
138
+ snippet: `'\${1:string}'`,
139
+ },
140
+ {
141
+ name: '$densify',
142
+ value: '$densify',
143
+ label: '$densify',
144
+ outputStage: false,
145
+ fullScan: false,
146
+ firstStage: false,
147
+ score: 1,
148
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
149
+ meta: 'stage',
150
+ version: '5.1.0',
151
+ apiVersions: [1],
152
+ namespaces: [...ns_1.ANY_NAMESPACE],
153
+ description: 'Creates new documents to eliminate the gaps in the time or numeric domain at the required granularity level.',
154
+ comment: `/**
155
+ * field: The required field to densify.
156
+ * partitionByFields: The set of fields that acts as a compound key to define each partition.
157
+ * range: {
158
+ * step: The amount to increment the field value in each document.
159
+ * unit: If specified field must evaluate to a date for every document in the collection, otherwise must evaluate to a numeric.
160
+ * bounds: A string or array of numeric/date bounds, corresponding to the type of the field.
161
+ * }
162
+ */
163
+ `,
164
+ snippet: `{
165
+ field: \${1:string},
166
+ partitionByFields: [\${2:string}, \${3:string}, ...],
167
+ range: {
168
+ step: \${4:number},
169
+ unit: \${5:string},
170
+ bounds: [\${6:lowerbound}, \${7:upperbound}, ...]
171
+ }
172
+ }`,
173
+ },
174
+ {
175
+ name: '$documents',
176
+ value: '$documents',
177
+ label: '$documents',
178
+ outputStage: false,
179
+ fullScan: false,
180
+ firstStage: false,
181
+ score: 1,
182
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
183
+ meta: 'stage',
184
+ version: '4.4.9',
185
+ apiVersions: [1],
186
+ namespaces: [ns_1.DATABASE],
187
+ description: 'Returns literal documents from input values.',
188
+ comment: `/**
189
+ * expression: Any valid expression.
190
+ */
191
+ `,
192
+ snippet: `{
193
+ \${1:expression}
194
+ }`,
195
+ },
196
+ {
197
+ name: '$facet',
198
+ value: '$facet',
199
+ label: '$facet',
200
+ outputStage: false,
201
+ fullScan: false,
202
+ firstStage: false,
203
+ score: 1,
204
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
205
+ meta: 'stage',
206
+ version: '3.4.0',
207
+ apiVersions: [1],
208
+ namespaces: [...ns_1.ANY_NAMESPACE],
209
+ description: 'Allows for multiple parellel aggregations to be specified.',
210
+ comment: `/**
211
+ * outputFieldN: The first output field.
212
+ * stageN: The first aggregation stage.
213
+ */
214
+ `,
215
+ snippet: `{
216
+ \${1:outputFieldN}: [ \${2:stageN}, \${3:...} ]
217
+ }`,
218
+ },
219
+ {
220
+ name: '$fill',
221
+ value: '$fill',
222
+ label: '$fill',
223
+ outputStage: false,
224
+ fullScan: false,
225
+ firstStage: false,
226
+ score: 1,
227
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
228
+ meta: 'stage',
229
+ version: '5.3.0',
230
+ apiVersions: [1],
231
+ namespaces: [...ns_1.ANY_NAMESPACE],
232
+ description: 'Populates null and missing field values within documents.',
233
+ comment: `/**
234
+ * sortBy: Syntax is the same as $sort, required if "method" is used in at least one output spec otherwise optional
235
+ * partitionBy: Optional, default is a single partition. Specification is the same as _id in $group (same as partitionBy in window functions).
236
+ * partitionByFields: Optional, set of fields that acts as a compound key to define each partition.
237
+ * output - Required, object for each field to fill in. For a single field, can be a single object.
238
+ * output.<field> - A field to be filled with value, if missing or null in the current document.
239
+ */
240
+ `,
241
+ snippet: `{
242
+ sortBy: \${1:sortSpec},
243
+ partitionBy: \${2:expression},
244
+ partitionByFields: [\${3:string}, \${4:string}, ...],
245
+ output: {
246
+ field1: {value: \${5:expression}},
247
+ field2: {method: \${6:string}},
248
+ ...
249
+ }
250
+ }`,
251
+ },
252
+ {
253
+ name: '$geoNear',
254
+ value: '$geoNear',
255
+ label: '$geoNear',
256
+ outputStage: false,
257
+ fullScan: false,
258
+ firstStage: false,
259
+ score: 1,
260
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
261
+ meta: 'stage',
262
+ version: '2.4.0',
263
+ apiVersions: [1],
264
+ namespaces: [...ns_1.ANY_NAMESPACE],
265
+ description: 'Returns documents based on proximity to a geospatial point.',
266
+ comment: `/**
267
+ * near: The point to search near.
268
+ * distanceField: The calculated distance.
269
+ * maxDistance: The maximum distance, in meters, documents can be before being excluded from results.
270
+ * query: Limits results that match the query
271
+ * includeLocs: Optional. Labels and includes the point used to match the document.
272
+ * num: Optional. The maximum number of documents to return.
273
+ * spherical: Defaults to false. Specifies whether to use spherical geometry.
274
+ */
275
+ `,
276
+ snippet: `{
277
+ near: { type: 'Point', coordinates: [ \${1:number}, \${2:number} ] },
278
+ distanceField: '\${3:string}',
279
+ maxDistance: \${4:number},
280
+ query: {\${5}},
281
+ includeLocs: '\${6}',
282
+ num: \${7:number},
283
+ spherical: \${8:boolean}
284
+ }`,
285
+ },
286
+ {
287
+ name: '$graphLookup',
288
+ value: '$graphLookup',
289
+ label: '$graphLookup',
290
+ outputStage: false,
291
+ fullScan: false,
292
+ firstStage: false,
293
+ score: 1,
294
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
295
+ meta: 'stage',
296
+ version: '3.4.0',
297
+ apiVersions: [1],
298
+ namespaces: [...ns_1.ANY_NAMESPACE],
299
+ description: 'Performs a recursive search on a collection.',
300
+ comment: `/**
301
+ * from: The target collection.
302
+ * startWith: Expression to start.
303
+ * connectFromField: Field to connect.
304
+ * connectToField: Field to connect to.
305
+ * as: Name of the array field.
306
+ * maxDepth: Optional max recursion depth.
307
+ * depthField: Optional Name of the depth field.
308
+ * restrictSearchWithMatch: Optional query.
309
+ */
310
+ `,
311
+ snippet: `{
312
+ from: '\${1:string}',
313
+ startWith: \${2:expression},
314
+ connectFromField: '\${3:string}',
315
+ connectToField: '\${4:string}',
316
+ as: '\${5:string}',
317
+ maxDepth: \${6:number},
318
+ depthField: '\${7:string}',
319
+ restrictSearchWithMatch: {\${8}}
320
+ }`,
321
+ },
322
+ {
323
+ name: '$group',
324
+ value: '$group',
325
+ label: '$group',
326
+ outputStage: false,
327
+ fullScan: true,
328
+ firstStage: false,
329
+ score: 1,
330
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
331
+ meta: 'stage',
332
+ version: '2.2.0',
333
+ apiVersions: [1],
334
+ namespaces: [...ns_1.ANY_NAMESPACE],
335
+ description: 'Groups documents by a specified expression.',
336
+ comment: `/**
337
+ * _id: The id of the group.
338
+ * fieldN: The first field name.
339
+ */
340
+ `,
341
+ snippet: `{
342
+ _id: \${1:expression},
343
+ \${2:fieldN}: {
344
+ \${3:accumulatorN}: \${4:expressionN}
345
+ }
346
+ }`,
347
+ },
348
+ {
349
+ name: '$indexStats',
350
+ value: '$indexStats',
351
+ label: '$indexStats',
352
+ outputStage: false,
353
+ fullScan: false,
354
+ firstStage: true,
355
+ score: 1,
356
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
357
+ meta: 'stage',
358
+ version: '3.2.0',
359
+ apiVersions: [],
360
+ namespaces: [...ns_1.ANY_NAMESPACE],
361
+ description: 'Returns statistics regarding the use of each index for the collection.',
362
+ comment: `/**
363
+ * No parameters.
364
+ */
365
+ `,
366
+ snippet: '{}',
367
+ },
368
+ {
369
+ name: '$limit',
370
+ value: '$limit',
371
+ label: '$limit',
372
+ outputStage: false,
373
+ fullScan: false,
374
+ firstStage: false,
375
+ score: 1,
376
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
377
+ meta: 'stage',
378
+ version: '2.2.0',
379
+ apiVersions: [1],
380
+ namespaces: [...ns_1.ANY_NAMESPACE],
381
+ description: 'Limits the number of documents that flow into subsequent stages.',
382
+ comment: `/**
383
+ * Provide the number of documents to limit.
384
+ */
385
+ `,
386
+ snippet: '${1:number}',
387
+ },
388
+ {
389
+ name: '$lookup',
390
+ value: '$lookup',
391
+ label: '$lookup',
392
+ outputStage: false,
393
+ fullScan: false,
394
+ firstStage: false,
395
+ score: 1,
396
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
397
+ meta: 'stage',
398
+ version: '3.2.0',
399
+ apiVersions: [1],
400
+ namespaces: [...ns_1.ANY_NAMESPACE],
401
+ description: 'Performs a join between two collections.',
402
+ comment: `/**
403
+ * from: The target collection.
404
+ * localField: The local join field.
405
+ * foreignField: The target join field.
406
+ * as: The name for the results.
407
+ * pipeline: Optional pipeline to run on the foreign collection.
408
+ * let: Optional variables to use in the pipeline field stages.
409
+ */
410
+ `,
411
+ snippet: `{
412
+ from: \${1:collection},
413
+ localField: \${2:field},
414
+ foreignField: \${3:field},
415
+ as: \${4:result}
416
+ }`,
417
+ },
418
+ {
419
+ name: '$match',
420
+ value: '$match',
421
+ label: '$match',
422
+ outputStage: false,
423
+ fullScan: false,
424
+ firstStage: false,
425
+ score: 1,
426
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
427
+ meta: 'stage',
428
+ version: '2.2.0',
429
+ apiVersions: [1],
430
+ namespaces: [...ns_1.ANY_NAMESPACE],
431
+ description: 'Filters the document stream to allow only matching documents to pass through to subsequent stages.',
432
+ comment: `/**
433
+ * query: The query in MQL.
434
+ */
435
+ `,
436
+ snippet: `{
437
+ \${1:query}
438
+ }`,
439
+ },
440
+ {
441
+ name: '$merge',
442
+ value: '$merge',
443
+ label: '$merge',
444
+ outputStage: true,
445
+ fullScan: false,
446
+ firstStage: false,
447
+ score: 1,
448
+ env: [env_1.ATLAS, env_1.ON_PREM],
449
+ meta: 'stage',
450
+ version: '4.1.11',
451
+ apiVersions: [1],
452
+ namespaces: [...ns_1.ANY_NAMESPACE],
453
+ description: 'Merges the resulting documents into a collection, optionally overriding existing documents.',
454
+ comment: `/**
455
+ * into: The target collection.
456
+ * on: Fields to identify.
457
+ * let: Defined variables.
458
+ * whenMatched: Action for matching docs.
459
+ * whenNotMatched: Action for non-matching docs.
460
+ */
461
+ `,
462
+ snippet: `{
463
+ into: '\${1:string}',
464
+ on: '\${2:string}',
465
+ let: '\${3:specification(s)}',
466
+ whenMatched: '\${4:string}',
467
+ whenNotMatched: '\${5:string}'
468
+ }`,
469
+ },
470
+ {
471
+ name: '$merge',
472
+ value: '$merge',
473
+ label: '$merge',
474
+ outputStage: true,
475
+ fullScan: false,
476
+ firstStage: false,
477
+ score: 1,
478
+ env: [env_1.ADL],
479
+ meta: 'stage',
480
+ version: '4.0.0',
481
+ apiVersions: [1],
482
+ namespaces: [...ns_1.ANY_NAMESPACE],
483
+ description: 'Merges the resulting documents into a collection, optionally overriding existing documents.',
484
+ comment: `/**
485
+ * atlas: Location to write the documents from the aggregation pipeline.
486
+ * on: Fields to identify.
487
+ * let: Defined variables.
488
+ * whenMatched: Action for matching docs.
489
+ * whenNotMatched: Action for non-matching docs.
490
+ */
491
+ `,
492
+ snippet: `{
493
+ into: {
494
+ atlas: {
495
+ clusterName: '\${1:atlasClusterName}',
496
+ db: '\${2:database}',
497
+ coll: '\${3:collection}',
498
+ projectId: '\${4:optionalAtlasProjectId}'
499
+ }
500
+ },
501
+ on: '\${5:identifier}',
502
+ let: { \${6:specification(s)} },
503
+ whenMatched: '\${7:string}',
504
+ whenNotMatched: '\${8:string}'
505
+ }`,
506
+ },
507
+ {
508
+ name: '$out',
509
+ value: '$out',
510
+ label: '$out',
511
+ outputStage: true,
512
+ fullScan: false,
513
+ firstStage: false,
514
+ score: 1,
515
+ env: [env_1.ATLAS, env_1.ON_PREM],
516
+ meta: 'stage',
517
+ version: '2.2.0',
518
+ apiVersions: [1],
519
+ namespaces: [...ns_1.ANY_NAMESPACE],
520
+ description: 'Writes the result of a pipeline to a new or existing collection.',
521
+ comment: `/**
522
+ * Provide the name of the output collection.
523
+ */
524
+ `,
525
+ snippet: `'\${1:string}'`,
526
+ },
527
+ {
528
+ name: '$out',
529
+ value: '$out',
530
+ label: '$out',
531
+ outputStage: true,
532
+ fullScan: false,
533
+ firstStage: false,
534
+ score: 1,
535
+ env: [env_1.ADL],
536
+ meta: 'stage',
537
+ version: '4.0.0',
538
+ apiVersions: [1],
539
+ namespaces: [...ns_1.ANY_NAMESPACE],
540
+ description: 'Writes the result of a pipeline to an Atlas cluster or S3 bucket.',
541
+ comment: `/**
542
+ * s3Url: A S3 URL to save the data.
543
+ * atlas: Parameters to save to Atlas.
544
+ */
545
+ `,
546
+ snippet: `{
547
+ s3: '\${1:s3url}',
548
+ atlas: {
549
+ db: '\${2:db}',
550
+ coll: '\${3:coll}',
551
+ projectId: '\${4:projectId}',
552
+ clusterName: '\${5:clusterName}'
553
+ }
554
+ }`,
555
+ },
556
+ {
557
+ name: '$project',
558
+ value: '$project',
559
+ label: '$project',
560
+ outputStage: false,
561
+ fullScan: false,
562
+ firstStage: false,
563
+ score: 1,
564
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
565
+ meta: 'stage',
566
+ version: '2.2.0',
567
+ apiVersions: [1],
568
+ namespaces: [...ns_1.ANY_NAMESPACE],
569
+ description: 'Adds new field(s) to a document with a computed value, or reassigns an existing field(s) with a computed value. Unlike $addFields, $project can also remove fields.',
570
+ comment: `/**
571
+ * specifications: The fields to
572
+ * include or exclude.
573
+ */
574
+ `,
575
+ snippet: `{
576
+ \${1:specification(s)}
577
+ }`,
578
+ },
579
+ {
580
+ name: '$redact',
581
+ value: '$redact',
582
+ label: '$redact',
583
+ outputStage: false,
584
+ fullScan: false,
585
+ firstStage: false,
586
+ score: 1,
587
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
588
+ meta: 'stage',
589
+ version: '2.6.0',
590
+ apiVersions: [1],
591
+ namespaces: [...ns_1.ANY_NAMESPACE],
592
+ description: 'Restricts the content for each document based on information stored in the documents themselves',
593
+ comment: `/**
594
+ * expression: Any valid expression that
595
+ * evaluates to $$DESCEND, $$PRUNE, or $$KEEP.
596
+ */
597
+ `,
598
+ snippet: `{
599
+ \${1:expression}
600
+ }`,
601
+ },
602
+ {
603
+ name: '$replaceWith',
604
+ value: '$replaceWith',
605
+ label: '$replaceWith',
606
+ outputStage: false,
607
+ fullScan: false,
608
+ firstStage: false,
609
+ score: 1,
610
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
611
+ meta: 'stage',
612
+ version: '4.2.0',
613
+ apiVersions: [1],
614
+ namespaces: [...ns_1.ANY_NAMESPACE],
615
+ description: 'Replaces a document with the specified embedded document.',
616
+ comment: `/**
617
+ * replacementDocument: A document or string.
618
+ */
619
+ `,
620
+ snippet: `{
621
+ newWith: \${1:replacementDocument}
622
+ }`,
623
+ },
624
+ {
625
+ name: '$replaceRoot',
626
+ value: '$replaceRoot',
627
+ label: '$replaceRoot',
628
+ outputStage: false,
629
+ fullScan: false,
630
+ firstStage: false,
631
+ score: 1,
632
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
633
+ meta: 'stage',
634
+ version: '3.4.0',
635
+ apiVersions: [1],
636
+ namespaces: [...ns_1.ANY_NAMESPACE],
637
+ description: 'Replaces a document with the specified embedded document.',
638
+ comment: `/**
639
+ * replacementDocument: A document or string.
640
+ */
641
+ `,
642
+ snippet: `{
643
+ newRoot: \${1:replacementDocument}
644
+ }`,
645
+ },
646
+ {
647
+ name: '$sample',
648
+ value: '$sample',
649
+ label: '$sample',
650
+ outputStage: false,
651
+ fullScan: false,
652
+ firstStage: false,
653
+ score: 1,
654
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
655
+ meta: 'stage',
656
+ version: '3.2.0',
657
+ apiVersions: [1],
658
+ namespaces: [...ns_1.ANY_COLLECTION_NAMESPACE],
659
+ description: 'Randomly selects the specified number of documents from its input.',
660
+ comment: `/**
661
+ * size: The number of documents to sample.
662
+ */
663
+ `,
664
+ snippet: `{
665
+ size: \${1:number}
666
+ }`,
667
+ },
668
+ {
669
+ name: '$search',
670
+ value: '$search',
671
+ label: '$search',
672
+ outputStage: false,
673
+ fullScan: false,
674
+ firstStage: false,
675
+ score: 1,
676
+ env: [env_1.ATLAS],
677
+ meta: 'stage',
678
+ version: '4.1.11',
679
+ apiVersions: [],
680
+ namespaces: [ns_1.COLLECTION],
681
+ description: 'Performs a full-text search on the specified field(s).',
682
+ comment: `/**
683
+ * index: The name of the Search index.
684
+ * text: Analyzed search, with required fields of query and path, the analyzed field(s) to search.
685
+ * term: Un-analyzed search.
686
+ * compound: Combines ops.
687
+ * span: Find in text field regions.
688
+ * exists: Test for presence of a field.
689
+ * near: Find near number or date.
690
+ * range: Find in numeric or date range.
691
+ */
692
+ `,
693
+ snippet: `{
694
+ index: '\${1:string}',
695
+ text: {
696
+ query: '\${2:string}',
697
+ path: '\${3:string}'
698
+ }
699
+ }`,
700
+ },
701
+ {
702
+ name: '$searchMeta',
703
+ value: '$searchMeta',
704
+ label: '$searchMeta',
705
+ outputStage: false,
706
+ fullScan: false,
707
+ firstStage: false,
708
+ score: 1,
709
+ env: [env_1.ATLAS],
710
+ meta: 'stage',
711
+ version: '4.4.9',
712
+ apiVersions: [],
713
+ namespaces: [ns_1.COLLECTION],
714
+ description: 'Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query.',
715
+ comment: `/**
716
+ * index: The name of the Search index.
717
+ * count: The count of the results.
718
+ * facet: {
719
+ * operator: Analyzed search, with required fields of query and path, can either be replaced with the name of a valid operator.
720
+ * facets: {
721
+ * stringFacet: Narrows search results based on unique string values, with required fields of type and path.
722
+ * numberFacet: Narrows search results by breaking them up into separate ranges of numbers, with required fields of type, path, and boundaries.
723
+ * dateFacet: Narrows search results by breaking them up into separate ranges of dates, with required fields of type, path, and boundaries.
724
+ * }
725
+ * }
726
+ */
727
+ `,
728
+ snippet: `{
729
+ index: \${1:string},
730
+ facet: {
731
+ operator: {
732
+ text: {
733
+ query: \${2:string},
734
+ path: \${3:string}
735
+ }
736
+ },
737
+ facets: {
738
+ \${4:stringFacet}: {
739
+ type: \${5:string},
740
+ path: \${6:string},
741
+ numBuckets: \${7:integer}
742
+ },
743
+ numberFacet: {
744
+ type: 'number',
745
+ path: \${8:string},
746
+ boundaries: [\${9:lowerbound}, \${10:upperbound}, ...],
747
+ default: \${11:string}
748
+ }
749
+ }
750
+ }
751
+ }`,
752
+ },
753
+ {
754
+ name: '$set',
755
+ value: '$set',
756
+ label: '$set',
757
+ outputStage: false,
758
+ fullScan: false,
759
+ firstStage: false,
760
+ score: 1,
761
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
762
+ meta: 'stage',
763
+ version: '4.2.0',
764
+ apiVersions: [1],
765
+ namespaces: [...ns_1.ANY_NAMESPACE],
766
+ description: 'Adds new fields to documents. $set outputs documents that contain all existing fields from the input documents and newly added fields.',
767
+ comment: `/**
768
+ * field: The field name
769
+ * expression: The expression.
770
+ */
771
+ `,
772
+ snippet: `{
773
+ \${1:field}: \${2:expression}
774
+ }`,
775
+ },
776
+ {
777
+ name: '$setWindowFields',
778
+ value: '$setWindowFields',
779
+ label: '$setWindowFields',
780
+ outputStage: false,
781
+ fullScan: false,
782
+ firstStage: false,
783
+ score: 1,
784
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
785
+ meta: 'stage',
786
+ version: '5.0.0',
787
+ apiVersions: [1],
788
+ namespaces: [...ns_1.ANY_NAMESPACE],
789
+ description: 'Capable of partitioning incoming data, and can apply one or more functions to defined windows within each partition.',
790
+ comment: `/**
791
+ * partitionBy: partitioning of data.
792
+ * sortBy: fields to sort by.
793
+ * output: {
794
+ * path: {
795
+ * function: The window function to compute over the given window.
796
+ * window: {
797
+ * documents: A number of documents before and after the current document.
798
+ * range: A range of possible values around the value in the current document's sortBy field.
799
+ * unit: Specifies the units for the window bounds.
800
+ * }
801
+ * }
802
+ * }
803
+ */
804
+ `,
805
+ snippet: `{
806
+ partitionBy: \${1:expression},
807
+ sortBy: \${2:sortSpec},
808
+ output: {
809
+ \${3:path}: {
810
+ \${4:function}: \${5:functionArgs},
811
+ window: {
812
+ documents: [\${6:lowerbound}, \${7:upperbound}],
813
+ range: [\${8:lowerbound}, \${9:upperbound}],
814
+ unit: \${10:string}
815
+ }
816
+ },
817
+ \${11:path2}: ...
818
+ }
819
+ }`,
820
+ },
821
+ {
822
+ name: '$skip',
823
+ value: '$skip',
824
+ label: '$skip',
825
+ outputStage: false,
826
+ fullScan: false,
827
+ firstStage: false,
828
+ score: 1,
829
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
830
+ meta: 'stage',
831
+ version: '2.2.0',
832
+ apiVersions: [1],
833
+ namespaces: [...ns_1.ANY_NAMESPACE],
834
+ description: 'Skips a specified number of documents before advancing to the next stage.',
835
+ comment: `/**
836
+ * Provide the number of documents to skip.
837
+ */
838
+ `,
839
+ snippet: '${1:number}',
840
+ },
841
+ {
842
+ name: '$sort',
843
+ value: '$sort',
844
+ label: '$sort',
845
+ outputStage: false,
846
+ fullScan: false,
847
+ firstStage: false,
848
+ score: 1,
849
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
850
+ meta: 'stage',
851
+ version: '2.2.0',
852
+ apiVersions: [1],
853
+ namespaces: [...ns_1.ANY_NAMESPACE],
854
+ description: 'Reorders the document stream by a specified sort key and direction.',
855
+ comment: `/**
856
+ * Provide any number of field/order pairs.
857
+ */
858
+ `,
859
+ snippet: `{
860
+ \${1:field1}: \${2:sortOrder}
861
+ }`,
862
+ },
863
+ {
864
+ name: '$sortByCount',
865
+ value: '$sortByCount',
866
+ label: '$sortByCount',
867
+ outputStage: false,
868
+ fullScan: false,
869
+ firstStage: false,
870
+ score: 1,
871
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
872
+ meta: 'stage',
873
+ version: '3.4.0',
874
+ apiVersions: [1],
875
+ namespaces: [...ns_1.ANY_NAMESPACE],
876
+ description: 'Groups incoming documents based on the value of a specified expression, then computes the count of documents in each distinct group.',
877
+ comment: `/**
878
+ * expression: Grouping expression or string.
879
+ */
880
+ `,
881
+ snippet: `{
882
+ \${1:expression}
883
+ }`,
884
+ },
885
+ {
886
+ name: '$unionWith',
887
+ value: '$unionWith',
888
+ label: '$unionWith',
889
+ outputStage: false,
890
+ fullScan: false,
891
+ firstStage: false,
892
+ score: 1,
893
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
894
+ meta: 'stage',
895
+ version: '4.4.0',
896
+ apiVersions: [1],
897
+ namespaces: [...ns_1.ANY_NAMESPACE],
898
+ description: 'Perform a union with a pipeline on another collection.',
899
+ comment: `/**
900
+ * coll: The collection name.
901
+ * pipeline: The pipeline on the other collection.
902
+ */
903
+ `,
904
+ snippet: `{
905
+ coll: '\${1:coll}',
906
+ pipeline: [\${2:pipeline}]
907
+ }`,
908
+ },
909
+ {
910
+ name: '$unset',
911
+ value: '$unset',
912
+ label: '$unset',
913
+ outputStage: false,
914
+ fullScan: false,
915
+ firstStage: false,
916
+ score: 1,
917
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
918
+ meta: 'stage',
919
+ version: '4.2.0',
920
+ apiVersions: [1],
921
+ namespaces: [...ns_1.ANY_NAMESPACE],
922
+ description: 'Excludes fields from the result document.',
923
+ comment: `/**
924
+ * Provide the field name to exclude.
925
+ * To exclude multiple fields, pass the field names in an array.
926
+ */
927
+ `,
928
+ snippet: `'\${1:string}'`,
929
+ },
930
+ {
931
+ name: '$unwind',
932
+ value: '$unwind',
933
+ label: '$unwind',
934
+ outputStage: false,
935
+ fullScan: false,
936
+ firstStage: false,
937
+ score: 1,
938
+ env: [env_1.ATLAS, env_1.ADL, env_1.ON_PREM],
939
+ meta: 'stage',
940
+ version: '2.2.0',
941
+ apiVersions: [1],
942
+ namespaces: [...ns_1.ANY_NAMESPACE],
943
+ description: 'Outputs a new document for each element in a specified array. ',
944
+ comment: `/**
945
+ * path: Path to the array field.
946
+ * includeArrayIndex: Optional name for index.
947
+ * preserveNullAndEmptyArrays: Optional
948
+ * toggle to unwind null and empty values.
949
+ */
950
+ `,
951
+ snippet: `{
952
+ path: \${1:path},
953
+ includeArrayIndex: '\${2:string}',
954
+ preserveNullAndEmptyArrays: \${3:boolean}
955
+ }`,
956
+ },
957
+ ];
958
+ exports.STAGE_OPERATORS = STAGE_OPERATORS;
959
+ const STAGE_OPERATOR_NAMES = STAGE_OPERATORS.map((op) => op.name);
960
+ exports.STAGE_OPERATOR_NAMES = STAGE_OPERATOR_NAMES;
961
+ const OUT_STAGES = STAGE_OPERATORS.filter((stage) => stage.outputStage);
962
+ exports.OUT_STAGES = OUT_STAGES;
963
+ const FULL_SCAN_STAGES = STAGE_OPERATORS.filter((stage) => stage.fullScan);
964
+ exports.FULL_SCAN_STAGES = FULL_SCAN_STAGES;
965
+ const REQUIRED_AS_FIRST_STAGE = STAGE_OPERATORS.filter((stage) => stage.firstStage);
966
+ exports.REQUIRED_AS_FIRST_STAGE = REQUIRED_AS_FIRST_STAGE;
967
+ //# sourceMappingURL=stage-operators.js.map