@mongosh/autocomplete 2.1.3 → 2.1.4

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.
package/lib/index.d.ts CHANGED
@@ -976,6 +976,12 @@ export declare const BASE_COMPLETIONS: ({
976
976
  readonly score: 1;
977
977
  readonly meta: "expr:cond";
978
978
  readonly version: "3.4.0";
979
+ } | {
980
+ readonly name: "$toHashedIndexKey";
981
+ readonly value: "$toHashedIndexKey";
982
+ readonly score: 1;
983
+ readonly meta: "expr:arith";
984
+ readonly version: "4.2.24";
979
985
  } | {
980
986
  readonly name: "$toLower";
981
987
  readonly value: "$toLower";
@@ -1333,6 +1339,22 @@ export declare const BASE_COMPLETIONS: ({
1333
1339
  readonly description: "Automatically categorizes documents into a specified number of buckets, attempting even distribution if possible.";
1334
1340
  readonly comment: "/**\n * groupBy: The expression to group by.\n * buckets: The desired number of buckets\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n * granularity: Optional number series\n */\n";
1335
1341
  readonly snippet: "{\n groupBy: ${1:expression},\n buckets: ${2:number},\n output: {\n ${3:outputN}: ${4:accumulator}, ${5:...}\n },\n granularity: '${6:string}'\n}";
1342
+ } | {
1343
+ readonly name: "$changeStream";
1344
+ readonly value: "$changeStream";
1345
+ readonly label: "$changeStream";
1346
+ readonly outputStage: false;
1347
+ readonly fullScan: false;
1348
+ readonly firstStage: true;
1349
+ readonly score: 1;
1350
+ readonly env: readonly ["atlas", "on-prem"];
1351
+ readonly meta: "stage";
1352
+ readonly version: "4.2.0";
1353
+ readonly apiVersions: readonly [1];
1354
+ readonly namespaces: readonly ["db"];
1355
+ readonly description: "Returns a Change Stream cursor for the collection.";
1356
+ readonly comment: "/**\n * allChangesForCluster: Optional boolean to include all changes in the cluster.\n * fullDocument: Optional value to request a copy of full document when modified by update operations (Introduced in 6.0).\n * fullDocumentBeforeChange: Value to configure whether to return a full document before the change or not.\n * resumeAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n * showExpandedEvents: Specifies whether to include additional change events, such as such as DDL and index operations (Introduced in 6.0).\n * startAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n * startAtOperationTime: Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n";
1357
+ readonly snippet: "{\n allChangesForCluster: ${1:boolean},\n fullDocument: '${2:string}',\n fullDocumentBeforeChange: '${3:string}',\n resumeAfter: ${4:resumeToken},\n showExpandedEvents: ${5:boolean},\n startAfter: ${6:resumeToken},\n startAtOperationTime: ${7:time},\n}";
1336
1358
  } | {
1337
1359
  readonly name: "$collStats";
1338
1360
  readonly value: "$collStats";
@@ -1365,6 +1387,22 @@ export declare const BASE_COMPLETIONS: ({
1365
1387
  readonly description: "Returns a count of the number of documents at this stage of the aggregation pipeline.";
1366
1388
  readonly comment: "/**\n * Provide the field name for the count.\n */\n";
1367
1389
  readonly snippet: "'${1:string}'";
1390
+ } | {
1391
+ readonly name: "$currentOp";
1392
+ readonly value: "$currentOp";
1393
+ readonly label: "$currentOp";
1394
+ readonly outputStage: false;
1395
+ readonly fullScan: false;
1396
+ readonly firstStage: true;
1397
+ readonly score: 1;
1398
+ readonly env: readonly ["atlas", "adl", "on-prem"];
1399
+ readonly meta: "stage";
1400
+ readonly version: "3.6.0";
1401
+ readonly apiVersions: readonly [1];
1402
+ readonly namespaces: readonly ["db"];
1403
+ readonly description: "Returns a cursor over information on active and/or dormant operations for the MongoDB deployment as well as inactive sessions that are holding locks as part of a transaction.";
1404
+ readonly comment: "/**\n * allUsers: Optional boolean value to specify whether to return operations for all users or not.\n * idleConnections: Optional boolean value to specify whether to return all operations including idle connections or not.\n * idleCursors: Optional boolean value to specify whether to report on cursors that are idle or not.\n * idleSessions: Optional boolean value to specify whether to report on dormant sessions or not.\n * localOps: Optional boolean value to specify whether to report on operations running locally on targetted mongos or not.\n * backtrace: Optional boolean value to specify whether callstack information is returned as part of the waitingForLatch output field.\n */\n";
1405
+ readonly snippet: "{\n allUsers: ${1:false},\n idleConnections: ${2:false},\n idleCursors: ${3:false},\n idleSessions: ${4:true},\n localOps: ${5:false},\n backtrace: ${6:false},\n}";
1368
1406
  } | {
1369
1407
  readonly name: "$densify";
1370
1408
  readonly value: "$densify";
@@ -1509,6 +1547,22 @@ export declare const BASE_COMPLETIONS: ({
1509
1547
  readonly description: "Limits the number of documents that flow into subsequent stages.";
1510
1548
  readonly comment: "/**\n * Provide the number of documents to limit.\n */\n";
1511
1549
  readonly snippet: "${1:number}";
1550
+ } | {
1551
+ readonly name: "$listLocalSessions";
1552
+ readonly value: "$listLocalSessions";
1553
+ readonly label: "$listLocalSessions";
1554
+ readonly outputStage: false;
1555
+ readonly fullScan: false;
1556
+ readonly firstStage: true;
1557
+ readonly score: 1;
1558
+ readonly env: readonly ["atlas", "on-prem"];
1559
+ readonly meta: "stage";
1560
+ readonly version: "3.6.0";
1561
+ readonly apiVersions: readonly [1];
1562
+ readonly namespaces: readonly ["db"];
1563
+ readonly description: "Lists the sessions cached in memory by the mongod or mongos instance.";
1564
+ readonly comment: "/**\n * users: Optional list of users for which local sessions need to be returned.\n * allUsers: Optional boolean value to specify whether to return local sessions for all users or not.\n */\n";
1565
+ readonly snippet: "{\n allUsers: ${1:false},\n users: [\n { user: '${2:string}', db: '${3:string}' }\n ]\n}";
1512
1566
  } | {
1513
1567
  readonly name: "$lookup";
1514
1568
  readonly value: "$lookup";
@@ -1587,8 +1641,8 @@ export declare const BASE_COMPLETIONS: ({
1587
1641
  readonly apiVersions: readonly [1];
1588
1642
  readonly namespaces: readonly ["db", "coll", "view", "timeseries"];
1589
1643
  readonly description: "Writes the result of a pipeline to a new or existing collection.";
1590
- readonly comment: "/**\n * Provide the name of the output collection.\n */\n";
1591
- readonly snippet: "'${1:string}'";
1644
+ readonly comment: "/**\n * Provide the name of the output database and collection.\n */\n";
1645
+ readonly snippet: "{\n db: '${1:string}',\n coll: '${2:string}',\n /*\n timeseries: {\n timeField: '${3:field}',\n bucketMaxSpanSeconds: '${4:number}',\n granularity: '${5:granularity}'\n }\n */\n}";
1592
1646
  } | {
1593
1647
  readonly name: "$out";
1594
1648
  readonly value: "$out";
@@ -1638,37 +1692,37 @@ export declare const BASE_COMPLETIONS: ({
1638
1692
  readonly comment: "/**\n * expression: Any valid expression that\n * evaluates to $$DESCEND, $$PRUNE, or $$KEEP.\n */\n";
1639
1693
  readonly snippet: "{\n ${1:expression}\n}";
1640
1694
  } | {
1641
- readonly name: "$replaceWith";
1642
- readonly value: "$replaceWith";
1643
- readonly label: "$replaceWith";
1695
+ readonly name: "$replaceRoot";
1696
+ readonly value: "$replaceRoot";
1697
+ readonly label: "$replaceRoot";
1644
1698
  readonly outputStage: false;
1645
1699
  readonly fullScan: false;
1646
1700
  readonly firstStage: false;
1647
1701
  readonly score: 1;
1648
1702
  readonly env: readonly ["atlas", "adl", "on-prem"];
1649
1703
  readonly meta: "stage";
1650
- readonly version: "4.2.0";
1704
+ readonly version: "3.4.0";
1651
1705
  readonly apiVersions: readonly [1];
1652
1706
  readonly namespaces: readonly ["db", "coll", "view", "timeseries"];
1653
1707
  readonly description: "Replaces a document with the specified embedded document.";
1654
1708
  readonly comment: "/**\n * replacementDocument: A document or string.\n */\n";
1655
- readonly snippet: "{\n newWith: ${1:replacementDocument}\n}";
1709
+ readonly snippet: "{\n newRoot: ${1:replacementDocument}\n}";
1656
1710
  } | {
1657
- readonly name: "$replaceRoot";
1658
- readonly value: "$replaceRoot";
1659
- readonly label: "$replaceRoot";
1711
+ readonly name: "$replaceWith";
1712
+ readonly value: "$replaceWith";
1713
+ readonly label: "$replaceWith";
1660
1714
  readonly outputStage: false;
1661
1715
  readonly fullScan: false;
1662
1716
  readonly firstStage: false;
1663
1717
  readonly score: 1;
1664
1718
  readonly env: readonly ["atlas", "adl", "on-prem"];
1665
1719
  readonly meta: "stage";
1666
- readonly version: "3.4.0";
1720
+ readonly version: "4.2.0";
1667
1721
  readonly apiVersions: readonly [1];
1668
1722
  readonly namespaces: readonly ["db", "coll", "view", "timeseries"];
1669
1723
  readonly description: "Replaces a document with the specified embedded document.";
1670
1724
  readonly comment: "/**\n * replacementDocument: A document or string.\n */\n";
1671
- readonly snippet: "{\n newRoot: ${1:replacementDocument}\n}";
1725
+ readonly snippet: "{\n newWith: ${1:replacementDocument}\n}";
1672
1726
  } | {
1673
1727
  readonly name: "$sample";
1674
1728
  readonly value: "$sample";
@@ -1717,22 +1771,6 @@ export declare const BASE_COMPLETIONS: ({
1717
1771
  readonly description: "Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query.";
1718
1772
  readonly comment: "/**\n * index: The name of the Search index.\n * count: The count of the results.\n * facet: {\n * operator: Analyzed search, with required fields of query and path, can either be replaced with the name of a valid operator.\n * facets: {\n * stringFacet: Narrows search results based on unique string values, with required fields of type and path.\n * numberFacet: Narrows search results by breaking them up into separate ranges of numbers, with required fields of type, path, and boundaries.\n * dateFacet: Narrows search results by breaking them up into separate ranges of dates, with required fields of type, path, and boundaries.\n * }\n * }\n */\n";
1719
1773
  readonly snippet: "{\n index: ${1:string},\n facet: {\n operator: {\n text: {\n query: ${2:string},\n path: ${3:string}\n }\n },\n facets: {\n ${4:stringFacet}: {\n type: ${5:string},\n path: ${6:string},\n numBuckets: ${7:integer}\n },\n numberFacet: {\n type: 'number',\n path: ${8:string},\n boundaries: [${9:lowerbound}, ${10:upperbound}, ...],\n default: ${11:string}\n }\n }\n }\n}";
1720
- } | {
1721
- readonly name: "$vectorSearch";
1722
- readonly value: "$vectorSearch";
1723
- readonly label: "$vectorSearch";
1724
- readonly outputStage: false;
1725
- readonly fullScan: false;
1726
- readonly firstStage: true;
1727
- readonly score: 1;
1728
- readonly env: readonly ["atlas"];
1729
- readonly meta: "stage";
1730
- readonly version: "7.0.2";
1731
- readonly apiVersions: readonly [];
1732
- readonly namespaces: readonly ["coll"];
1733
- readonly description: "Performs a kNN search on a vector in the specified field or fields. The field that you want to search must be covered by an Atlas Search index of type `vectorEmbedding`.";
1734
- readonly comment: "/**\n * queryVector: Array of numbers of BSON types `int` or `double` that represent the query vector. The array size must match the number of vector dimensions specified in the index for the field. (Required)\n * path: The field to search. (Required)\n * numCandidates: Number of nearest neighbors to use during the search. You can specify a number higher than the number of documents to return (`limit`) to increase accuracy. (Required)\n * index: Name of the Atlas Search index to use. (Required)\n * limit: Number (of type `int` only) of documents to return in the results. (Required)\n * filter: Any MongoDB Query Language (MQL) match expression that compares an indexed field with a boolean, number (not decimals), or string to use as a prefilter. (Optional)\n */\n";
1735
- readonly snippet: "{\n queryVector: [${1:dimension1}, ${2:dimension2}, ...],\n path: ${3:string},\n numCandidates: ${4:numCandidates},\n index: ${5:string},\n limit: ${6:limit},\n filter: {${7:expression}}\n}";
1736
1774
  } | {
1737
1775
  readonly name: "$set";
1738
1776
  readonly value: "$set";
@@ -1862,53 +1900,21 @@ export declare const BASE_COMPLETIONS: ({
1862
1900
  readonly comment: "/**\n * path: Path to the array field.\n * includeArrayIndex: Optional name for index.\n * preserveNullAndEmptyArrays: Optional\n * toggle to unwind null and empty values.\n */\n";
1863
1901
  readonly snippet: "{\n path: ${1:path},\n includeArrayIndex: '${2:string}',\n preserveNullAndEmptyArrays: ${3:boolean}\n}";
1864
1902
  } | {
1865
- readonly name: "$changeStream";
1866
- readonly value: "$changeStream";
1867
- readonly label: "$changeStream";
1868
- readonly outputStage: false;
1869
- readonly fullScan: false;
1870
- readonly firstStage: true;
1871
- readonly score: 1;
1872
- readonly env: readonly ["atlas", "on-prem"];
1873
- readonly meta: "stage";
1874
- readonly version: "4.2.0";
1875
- readonly apiVersions: readonly [1];
1876
- readonly namespaces: readonly ["db"];
1877
- readonly description: "Returns a Change Stream cursor for the collection.";
1878
- readonly comment: "/**\n * allChangesForCluster: Optional boolean to include all changes in the cluster.\n * fullDocument: Optional value to request a copy of full document when modified by update operations (Introduced in 6.0).\n * fullDocumentBeforeChange: Value to configure whether to return a full document before the change or not.\n * resumeAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n * showExpandedEvents: Specifies whether to include additional change events, such as such as DDL and index operations (Introduced in 6.0).\n * startAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n * startAtOperationTime: Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n";
1879
- readonly snippet: "{\n allChangesForCluster: ${1:boolean},\n fullDocument: '${2:string}',\n fullDocumentBeforeChange: '${3:string}',\n resumeAfter: ${4:resumeToken},\n showExpandedEvents: ${5:boolean},\n startAfter: ${6:resumeToken},\n startAtOperationTime: ${7:time},\n}";
1880
- } | {
1881
- readonly name: "$currentOp";
1882
- readonly value: "$currentOp";
1883
- readonly label: "$currentOp";
1884
- readonly outputStage: false;
1885
- readonly fullScan: false;
1886
- readonly firstStage: true;
1887
- readonly score: 1;
1888
- readonly env: readonly ["atlas", "adl", "on-prem"];
1889
- readonly meta: "stage";
1890
- readonly version: "3.6.0";
1891
- readonly apiVersions: readonly [1];
1892
- readonly namespaces: readonly ["db"];
1893
- readonly description: "Returns a cursor over information on active and/or dormant operations for the MongoDB deployment as well as inactive sessions that are holding locks as part of a transaction.";
1894
- readonly comment: "/**\n * allUsers: Optional boolean value to specify whether to return operations for all users or not.\n * idleConnections: Optional boolean value to specify whether to return all operations including idle connections or not.\n * idleCursors: Optional boolean value to specify whether to report on cursors that are idle or not.\n * idleSessions: Optional boolean value to specify whether to report on dormant sessions or not.\n * localOps: Optional boolean value to specify whether to report on operations running locally on targetted mongos or not.\n * backtrace: Optional boolean value to specify whether callstack information is returned as part of the waitingForLatch output field.\n */\n";
1895
- readonly snippet: "{\n allUsers: ${1:false},\n idleConnections: ${2:false},\n idleCursors: ${3:false},\n idleSessions: ${4:true},\n localOps: ${5:false},\n backtrace: ${6:false},\n}";
1896
- } | {
1897
- readonly name: "$listLocalSessions";
1898
- readonly value: "$listLocalSessions";
1899
- readonly label: "$listLocalSessions";
1903
+ readonly name: "$vectorSearch";
1904
+ readonly value: "$vectorSearch";
1905
+ readonly label: "$vectorSearch";
1900
1906
  readonly outputStage: false;
1901
1907
  readonly fullScan: false;
1902
1908
  readonly firstStage: true;
1903
1909
  readonly score: 1;
1904
- readonly env: readonly ["atlas", "on-prem"];
1910
+ readonly env: readonly ["atlas"];
1905
1911
  readonly meta: "stage";
1906
- readonly version: "3.6.0";
1907
- readonly apiVersions: readonly [1];
1908
- readonly namespaces: readonly ["db"];
1909
- readonly description: "Lists the sessions cached in memory by the mongod or mongos instance.";
1910
- readonly comment: "/**\n * users: Optional list of users for which local sessions need to be returned.\n * allUsers: Optional boolean value to specify whether to return local sessions for all users or not.\n */\n";
1911
- readonly snippet: "{\n allUsers: ${1:false},\n users: [\n { user: '${2:string}', db: '${3:string}' }\n ]\n}";
1912
+ readonly version: ">=6.0.10 <7.0.0 || >=7.0.2";
1913
+ readonly apiVersions: readonly [];
1914
+ readonly namespaces: readonly ["coll"];
1915
+ readonly description: "Performs a kNN search on a vector in the specified field or fields. The field that you want to search must be covered by an Atlas Search index of type `vectorEmbedding`.";
1916
+ readonly comment: "/**\n * queryVector: Array of numbers of BSON types `int` or `double` that represent the query vector. The array size must match the number of vector dimensions specified in the index for the field. (Required)\n * path: The field to search. (Required)\n * numCandidates: Number of nearest neighbors to use during the search. You can specify a number higher than the number of documents to return (`limit`) to increase accuracy. (Required)\n * index: Name of the Atlas Search index to use. (Required)\n * limit: Number (of type `int` only) of documents to return in the results. (Required)\n * filter: Any MongoDB Query Language (MQL) match expression that compares an indexed field with a boolean, number (not decimals), or string to use as a prefilter. (Optional)\n */\n";
1917
+ readonly snippet: "{\n queryVector: [${1:dimension1}, ${2:dimension2}, ...],\n path: ${3:string},\n numCandidates: ${4:numCandidates},\n index: ${5:string},\n limit: ${6:limit},\n filter: {${7:expression}}\n}";
1912
1918
  })[];
1913
1919
  export declare const MATCH_COMPLETIONS: ({
1914
1920
  readonly name: "$accumulator";
@@ -2872,6 +2878,12 @@ export declare const MATCH_COMPLETIONS: ({
2872
2878
  readonly score: 1;
2873
2879
  readonly meta: "expr:cond";
2874
2880
  readonly version: "3.4.0";
2881
+ } | {
2882
+ readonly name: "$toHashedIndexKey";
2883
+ readonly value: "$toHashedIndexKey";
2884
+ readonly score: 1;
2885
+ readonly meta: "expr:arith";
2886
+ readonly version: "4.2.24";
2875
2887
  } | {
2876
2888
  readonly name: "$toLower";
2877
2889
  readonly value: "$toLower";
@@ -3229,6 +3241,22 @@ export declare const MATCH_COMPLETIONS: ({
3229
3241
  readonly description: "Automatically categorizes documents into a specified number of buckets, attempting even distribution if possible.";
3230
3242
  readonly comment: "/**\n * groupBy: The expression to group by.\n * buckets: The desired number of buckets\n * output: {\n * outputN: Optional. The output object may contain a single or numerous field names used to accumulate values per bucket.\n * }\n * granularity: Optional number series\n */\n";
3231
3243
  readonly snippet: "{\n groupBy: ${1:expression},\n buckets: ${2:number},\n output: {\n ${3:outputN}: ${4:accumulator}, ${5:...}\n },\n granularity: '${6:string}'\n}";
3244
+ } | {
3245
+ readonly name: "$changeStream";
3246
+ readonly value: "$changeStream";
3247
+ readonly label: "$changeStream";
3248
+ readonly outputStage: false;
3249
+ readonly fullScan: false;
3250
+ readonly firstStage: true;
3251
+ readonly score: 1;
3252
+ readonly env: readonly ["atlas", "on-prem"];
3253
+ readonly meta: "stage";
3254
+ readonly version: "4.2.0";
3255
+ readonly apiVersions: readonly [1];
3256
+ readonly namespaces: readonly ["db"];
3257
+ readonly description: "Returns a Change Stream cursor for the collection.";
3258
+ readonly comment: "/**\n * allChangesForCluster: Optional boolean to include all changes in the cluster.\n * fullDocument: Optional value to request a copy of full document when modified by update operations (Introduced in 6.0).\n * fullDocumentBeforeChange: Value to configure whether to return a full document before the change or not.\n * resumeAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n * showExpandedEvents: Specifies whether to include additional change events, such as such as DDL and index operations (Introduced in 6.0).\n * startAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n * startAtOperationTime: Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n";
3259
+ readonly snippet: "{\n allChangesForCluster: ${1:boolean},\n fullDocument: '${2:string}',\n fullDocumentBeforeChange: '${3:string}',\n resumeAfter: ${4:resumeToken},\n showExpandedEvents: ${5:boolean},\n startAfter: ${6:resumeToken},\n startAtOperationTime: ${7:time},\n}";
3232
3260
  } | {
3233
3261
  readonly name: "$collStats";
3234
3262
  readonly value: "$collStats";
@@ -3261,6 +3289,22 @@ export declare const MATCH_COMPLETIONS: ({
3261
3289
  readonly description: "Returns a count of the number of documents at this stage of the aggregation pipeline.";
3262
3290
  readonly comment: "/**\n * Provide the field name for the count.\n */\n";
3263
3291
  readonly snippet: "'${1:string}'";
3292
+ } | {
3293
+ readonly name: "$currentOp";
3294
+ readonly value: "$currentOp";
3295
+ readonly label: "$currentOp";
3296
+ readonly outputStage: false;
3297
+ readonly fullScan: false;
3298
+ readonly firstStage: true;
3299
+ readonly score: 1;
3300
+ readonly env: readonly ["atlas", "adl", "on-prem"];
3301
+ readonly meta: "stage";
3302
+ readonly version: "3.6.0";
3303
+ readonly apiVersions: readonly [1];
3304
+ readonly namespaces: readonly ["db"];
3305
+ readonly description: "Returns a cursor over information on active and/or dormant operations for the MongoDB deployment as well as inactive sessions that are holding locks as part of a transaction.";
3306
+ readonly comment: "/**\n * allUsers: Optional boolean value to specify whether to return operations for all users or not.\n * idleConnections: Optional boolean value to specify whether to return all operations including idle connections or not.\n * idleCursors: Optional boolean value to specify whether to report on cursors that are idle or not.\n * idleSessions: Optional boolean value to specify whether to report on dormant sessions or not.\n * localOps: Optional boolean value to specify whether to report on operations running locally on targetted mongos or not.\n * backtrace: Optional boolean value to specify whether callstack information is returned as part of the waitingForLatch output field.\n */\n";
3307
+ readonly snippet: "{\n allUsers: ${1:false},\n idleConnections: ${2:false},\n idleCursors: ${3:false},\n idleSessions: ${4:true},\n localOps: ${5:false},\n backtrace: ${6:false},\n}";
3264
3308
  } | {
3265
3309
  readonly name: "$densify";
3266
3310
  readonly value: "$densify";
@@ -3405,6 +3449,22 @@ export declare const MATCH_COMPLETIONS: ({
3405
3449
  readonly description: "Limits the number of documents that flow into subsequent stages.";
3406
3450
  readonly comment: "/**\n * Provide the number of documents to limit.\n */\n";
3407
3451
  readonly snippet: "${1:number}";
3452
+ } | {
3453
+ readonly name: "$listLocalSessions";
3454
+ readonly value: "$listLocalSessions";
3455
+ readonly label: "$listLocalSessions";
3456
+ readonly outputStage: false;
3457
+ readonly fullScan: false;
3458
+ readonly firstStage: true;
3459
+ readonly score: 1;
3460
+ readonly env: readonly ["atlas", "on-prem"];
3461
+ readonly meta: "stage";
3462
+ readonly version: "3.6.0";
3463
+ readonly apiVersions: readonly [1];
3464
+ readonly namespaces: readonly ["db"];
3465
+ readonly description: "Lists the sessions cached in memory by the mongod or mongos instance.";
3466
+ readonly comment: "/**\n * users: Optional list of users for which local sessions need to be returned.\n * allUsers: Optional boolean value to specify whether to return local sessions for all users or not.\n */\n";
3467
+ readonly snippet: "{\n allUsers: ${1:false},\n users: [\n { user: '${2:string}', db: '${3:string}' }\n ]\n}";
3408
3468
  } | {
3409
3469
  readonly name: "$lookup";
3410
3470
  readonly value: "$lookup";
@@ -3483,8 +3543,8 @@ export declare const MATCH_COMPLETIONS: ({
3483
3543
  readonly apiVersions: readonly [1];
3484
3544
  readonly namespaces: readonly ["db", "coll", "view", "timeseries"];
3485
3545
  readonly description: "Writes the result of a pipeline to a new or existing collection.";
3486
- readonly comment: "/**\n * Provide the name of the output collection.\n */\n";
3487
- readonly snippet: "'${1:string}'";
3546
+ readonly comment: "/**\n * Provide the name of the output database and collection.\n */\n";
3547
+ readonly snippet: "{\n db: '${1:string}',\n coll: '${2:string}',\n /*\n timeseries: {\n timeField: '${3:field}',\n bucketMaxSpanSeconds: '${4:number}',\n granularity: '${5:granularity}'\n }\n */\n}";
3488
3548
  } | {
3489
3549
  readonly name: "$out";
3490
3550
  readonly value: "$out";
@@ -3534,37 +3594,37 @@ export declare const MATCH_COMPLETIONS: ({
3534
3594
  readonly comment: "/**\n * expression: Any valid expression that\n * evaluates to $$DESCEND, $$PRUNE, or $$KEEP.\n */\n";
3535
3595
  readonly snippet: "{\n ${1:expression}\n}";
3536
3596
  } | {
3537
- readonly name: "$replaceWith";
3538
- readonly value: "$replaceWith";
3539
- readonly label: "$replaceWith";
3597
+ readonly name: "$replaceRoot";
3598
+ readonly value: "$replaceRoot";
3599
+ readonly label: "$replaceRoot";
3540
3600
  readonly outputStage: false;
3541
3601
  readonly fullScan: false;
3542
3602
  readonly firstStage: false;
3543
3603
  readonly score: 1;
3544
3604
  readonly env: readonly ["atlas", "adl", "on-prem"];
3545
3605
  readonly meta: "stage";
3546
- readonly version: "4.2.0";
3606
+ readonly version: "3.4.0";
3547
3607
  readonly apiVersions: readonly [1];
3548
3608
  readonly namespaces: readonly ["db", "coll", "view", "timeseries"];
3549
3609
  readonly description: "Replaces a document with the specified embedded document.";
3550
3610
  readonly comment: "/**\n * replacementDocument: A document or string.\n */\n";
3551
- readonly snippet: "{\n newWith: ${1:replacementDocument}\n}";
3611
+ readonly snippet: "{\n newRoot: ${1:replacementDocument}\n}";
3552
3612
  } | {
3553
- readonly name: "$replaceRoot";
3554
- readonly value: "$replaceRoot";
3555
- readonly label: "$replaceRoot";
3613
+ readonly name: "$replaceWith";
3614
+ readonly value: "$replaceWith";
3615
+ readonly label: "$replaceWith";
3556
3616
  readonly outputStage: false;
3557
3617
  readonly fullScan: false;
3558
3618
  readonly firstStage: false;
3559
3619
  readonly score: 1;
3560
3620
  readonly env: readonly ["atlas", "adl", "on-prem"];
3561
3621
  readonly meta: "stage";
3562
- readonly version: "3.4.0";
3622
+ readonly version: "4.2.0";
3563
3623
  readonly apiVersions: readonly [1];
3564
3624
  readonly namespaces: readonly ["db", "coll", "view", "timeseries"];
3565
3625
  readonly description: "Replaces a document with the specified embedded document.";
3566
3626
  readonly comment: "/**\n * replacementDocument: A document or string.\n */\n";
3567
- readonly snippet: "{\n newRoot: ${1:replacementDocument}\n}";
3627
+ readonly snippet: "{\n newWith: ${1:replacementDocument}\n}";
3568
3628
  } | {
3569
3629
  readonly name: "$sample";
3570
3630
  readonly value: "$sample";
@@ -3613,22 +3673,6 @@ export declare const MATCH_COMPLETIONS: ({
3613
3673
  readonly description: "Performs a full-text search on the specified field(s) and gets back only the generated search meta data from a query.";
3614
3674
  readonly comment: "/**\n * index: The name of the Search index.\n * count: The count of the results.\n * facet: {\n * operator: Analyzed search, with required fields of query and path, can either be replaced with the name of a valid operator.\n * facets: {\n * stringFacet: Narrows search results based on unique string values, with required fields of type and path.\n * numberFacet: Narrows search results by breaking them up into separate ranges of numbers, with required fields of type, path, and boundaries.\n * dateFacet: Narrows search results by breaking them up into separate ranges of dates, with required fields of type, path, and boundaries.\n * }\n * }\n */\n";
3615
3675
  readonly snippet: "{\n index: ${1:string},\n facet: {\n operator: {\n text: {\n query: ${2:string},\n path: ${3:string}\n }\n },\n facets: {\n ${4:stringFacet}: {\n type: ${5:string},\n path: ${6:string},\n numBuckets: ${7:integer}\n },\n numberFacet: {\n type: 'number',\n path: ${8:string},\n boundaries: [${9:lowerbound}, ${10:upperbound}, ...],\n default: ${11:string}\n }\n }\n }\n}";
3616
- } | {
3617
- readonly name: "$vectorSearch";
3618
- readonly value: "$vectorSearch";
3619
- readonly label: "$vectorSearch";
3620
- readonly outputStage: false;
3621
- readonly fullScan: false;
3622
- readonly firstStage: true;
3623
- readonly score: 1;
3624
- readonly env: readonly ["atlas"];
3625
- readonly meta: "stage";
3626
- readonly version: "7.0.2";
3627
- readonly apiVersions: readonly [];
3628
- readonly namespaces: readonly ["coll"];
3629
- readonly description: "Performs a kNN search on a vector in the specified field or fields. The field that you want to search must be covered by an Atlas Search index of type `vectorEmbedding`.";
3630
- readonly comment: "/**\n * queryVector: Array of numbers of BSON types `int` or `double` that represent the query vector. The array size must match the number of vector dimensions specified in the index for the field. (Required)\n * path: The field to search. (Required)\n * numCandidates: Number of nearest neighbors to use during the search. You can specify a number higher than the number of documents to return (`limit`) to increase accuracy. (Required)\n * index: Name of the Atlas Search index to use. (Required)\n * limit: Number (of type `int` only) of documents to return in the results. (Required)\n * filter: Any MongoDB Query Language (MQL) match expression that compares an indexed field with a boolean, number (not decimals), or string to use as a prefilter. (Optional)\n */\n";
3631
- readonly snippet: "{\n queryVector: [${1:dimension1}, ${2:dimension2}, ...],\n path: ${3:string},\n numCandidates: ${4:numCandidates},\n index: ${5:string},\n limit: ${6:limit},\n filter: {${7:expression}}\n}";
3632
3676
  } | {
3633
3677
  readonly name: "$set";
3634
3678
  readonly value: "$set";
@@ -3758,53 +3802,21 @@ export declare const MATCH_COMPLETIONS: ({
3758
3802
  readonly comment: "/**\n * path: Path to the array field.\n * includeArrayIndex: Optional name for index.\n * preserveNullAndEmptyArrays: Optional\n * toggle to unwind null and empty values.\n */\n";
3759
3803
  readonly snippet: "{\n path: ${1:path},\n includeArrayIndex: '${2:string}',\n preserveNullAndEmptyArrays: ${3:boolean}\n}";
3760
3804
  } | {
3761
- readonly name: "$changeStream";
3762
- readonly value: "$changeStream";
3763
- readonly label: "$changeStream";
3764
- readonly outputStage: false;
3765
- readonly fullScan: false;
3766
- readonly firstStage: true;
3767
- readonly score: 1;
3768
- readonly env: readonly ["atlas", "on-prem"];
3769
- readonly meta: "stage";
3770
- readonly version: "4.2.0";
3771
- readonly apiVersions: readonly [1];
3772
- readonly namespaces: readonly ["db"];
3773
- readonly description: "Returns a Change Stream cursor for the collection.";
3774
- readonly comment: "/**\n * allChangesForCluster: Optional boolean to include all changes in the cluster.\n * fullDocument: Optional value to request a copy of full document when modified by update operations (Introduced in 6.0).\n * fullDocumentBeforeChange: Value to configure whether to return a full document before the change or not.\n * resumeAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with startAfter or startAtOperationTime fields.\n * showExpandedEvents: Specifies whether to include additional change events, such as such as DDL and index operations (Introduced in 6.0).\n * startAfter: Specifies a resume token as the logical starting point for the change stream. Cannot be used with resumeAfter or startAtOperationTime fields.\n * startAtOperationTime: Specifies a time as the logical starting point for the change stream. Cannot be used with resumeAfter or startAfter fields.\n */\n";
3775
- readonly snippet: "{\n allChangesForCluster: ${1:boolean},\n fullDocument: '${2:string}',\n fullDocumentBeforeChange: '${3:string}',\n resumeAfter: ${4:resumeToken},\n showExpandedEvents: ${5:boolean},\n startAfter: ${6:resumeToken},\n startAtOperationTime: ${7:time},\n}";
3776
- } | {
3777
- readonly name: "$currentOp";
3778
- readonly value: "$currentOp";
3779
- readonly label: "$currentOp";
3780
- readonly outputStage: false;
3781
- readonly fullScan: false;
3782
- readonly firstStage: true;
3783
- readonly score: 1;
3784
- readonly env: readonly ["atlas", "adl", "on-prem"];
3785
- readonly meta: "stage";
3786
- readonly version: "3.6.0";
3787
- readonly apiVersions: readonly [1];
3788
- readonly namespaces: readonly ["db"];
3789
- readonly description: "Returns a cursor over information on active and/or dormant operations for the MongoDB deployment as well as inactive sessions that are holding locks as part of a transaction.";
3790
- readonly comment: "/**\n * allUsers: Optional boolean value to specify whether to return operations for all users or not.\n * idleConnections: Optional boolean value to specify whether to return all operations including idle connections or not.\n * idleCursors: Optional boolean value to specify whether to report on cursors that are idle or not.\n * idleSessions: Optional boolean value to specify whether to report on dormant sessions or not.\n * localOps: Optional boolean value to specify whether to report on operations running locally on targetted mongos or not.\n * backtrace: Optional boolean value to specify whether callstack information is returned as part of the waitingForLatch output field.\n */\n";
3791
- readonly snippet: "{\n allUsers: ${1:false},\n idleConnections: ${2:false},\n idleCursors: ${3:false},\n idleSessions: ${4:true},\n localOps: ${5:false},\n backtrace: ${6:false},\n}";
3792
- } | {
3793
- readonly name: "$listLocalSessions";
3794
- readonly value: "$listLocalSessions";
3795
- readonly label: "$listLocalSessions";
3805
+ readonly name: "$vectorSearch";
3806
+ readonly value: "$vectorSearch";
3807
+ readonly label: "$vectorSearch";
3796
3808
  readonly outputStage: false;
3797
3809
  readonly fullScan: false;
3798
3810
  readonly firstStage: true;
3799
3811
  readonly score: 1;
3800
- readonly env: readonly ["atlas", "on-prem"];
3812
+ readonly env: readonly ["atlas"];
3801
3813
  readonly meta: "stage";
3802
- readonly version: "3.6.0";
3803
- readonly apiVersions: readonly [1];
3804
- readonly namespaces: readonly ["db"];
3805
- readonly description: "Lists the sessions cached in memory by the mongod or mongos instance.";
3806
- readonly comment: "/**\n * users: Optional list of users for which local sessions need to be returned.\n * allUsers: Optional boolean value to specify whether to return local sessions for all users or not.\n */\n";
3807
- readonly snippet: "{\n allUsers: ${1:false},\n users: [\n { user: '${2:string}', db: '${3:string}' }\n ]\n}";
3814
+ readonly version: ">=6.0.10 <7.0.0 || >=7.0.2";
3815
+ readonly apiVersions: readonly [];
3816
+ readonly namespaces: readonly ["coll"];
3817
+ readonly description: "Performs a kNN search on a vector in the specified field or fields. The field that you want to search must be covered by an Atlas Search index of type `vectorEmbedding`.";
3818
+ readonly comment: "/**\n * queryVector: Array of numbers of BSON types `int` or `double` that represent the query vector. The array size must match the number of vector dimensions specified in the index for the field. (Required)\n * path: The field to search. (Required)\n * numCandidates: Number of nearest neighbors to use during the search. You can specify a number higher than the number of documents to return (`limit`) to increase accuracy. (Required)\n * index: Name of the Atlas Search index to use. (Required)\n * limit: Number (of type `int` only) of documents to return in the results. (Required)\n * filter: Any MongoDB Query Language (MQL) match expression that compares an indexed field with a boolean, number (not decimals), or string to use as a prefilter. (Optional)\n */\n";
3819
+ readonly snippet: "{\n queryVector: [${1:dimension1}, ${2:dimension2}, ...],\n path: ${3:string},\n numCandidates: ${4:numCandidates},\n index: ${5:string},\n limit: ${6:limit},\n filter: {${7:expression}}\n}";
3808
3820
  })[];
3809
3821
  declare function completer(params: AutocompleteParameters, line: string): Promise<[string[], string, 'exclusive'] | [string[], string]>;
3810
3822
  export default completer;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@mongosh/autocomplete",
3
- "version": "2.1.3",
3
+ "version": "2.1.4",
4
4
  "description": "MongoDB Shell Autocomplete Package",
5
5
  "homepage": "https://github.com/mongodb-js/mongosh",
6
6
  "license": "Apache-2.0",
@@ -34,18 +34,18 @@
34
34
  "unitTestsOnly": true
35
35
  },
36
36
  "devDependencies": {
37
- "@mongodb-js/eslint-config-mongosh": "^1.0.0",
37
+ "@mongodb-js/eslint-config-mongosh": "2.1.4",
38
38
  "@mongodb-js/prettier-config-devtools": "^1.0.1",
39
- "@mongodb-js/tsconfig-mongosh": "^1.0.0",
39
+ "@mongodb-js/tsconfig-mongosh": "2.1.4",
40
40
  "depcheck": "^1.4.3",
41
41
  "eslint": "^7.25.0",
42
42
  "mocha": "^10.2.0",
43
43
  "prettier": "^2.8.8"
44
44
  },
45
45
  "dependencies": {
46
- "@mongodb-js/mongodb-constants": "^0.7.1",
47
- "@mongosh/shell-api": "2.1.3",
46
+ "@mongodb-js/mongodb-constants": "^0.8.10",
47
+ "@mongosh/shell-api": "2.1.4",
48
48
  "semver": "^7.5.4"
49
49
  },
50
- "gitHead": "9ebc147d83037e9217dcd788f8092ae73010c9d6"
50
+ "gitHead": "aa68f995797d6ca42337c932408d1923924ca714"
51
51
  }
package/src/index.spec.ts CHANGED
@@ -460,9 +460,9 @@ describe('completer.completer', function () {
460
460
  ]);
461
461
  expect(await completer(standalone600, query)).to.deep.equal([
462
462
  [
463
- 'db.aggregate([{$documents',
464
463
  'db.aggregate([{$changeStream',
465
464
  'db.aggregate([{$currentOp',
465
+ 'db.aggregate([{$documents',
466
466
  'db.aggregate([{$listLocalSessions',
467
467
  ],
468
468
  query,