@mongosh/shell-api 3.15.0 → 3.16.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.
- package/lib/api-export.js +1 -1
- package/lib/api-processed.d.ts +42 -39
- package/lib/api-raw.d.ts +45 -39
- package/lib/bulk.d.ts +3 -2
- package/lib/bulk.js.map +1 -1
- package/lib/collection.d.ts +14 -13
- package/lib/collection.js.map +1 -1
- package/lib/database.d.ts +6 -5
- package/lib/database.js.map +1 -1
- package/lib/explainable.d.ts +10 -9
- package/lib/explainable.js.map +1 -1
- package/lib/helpers.d.ts +3 -2
- package/lib/helpers.js.map +1 -1
- package/lib/mongo.d.ts +2 -1
- package/lib/mongo.js.map +1 -1
- package/lib/mql-types.d.ts +4 -0
- package/lib/mql-types.js +3 -0
- package/lib/mql-types.js.map +1 -0
- package/lib/plan-cache.d.ts +3 -2
- package/lib/plan-cache.js.map +1 -1
- package/lib/shard.d.ts +4 -3
- package/lib/shard.js.map +1 -1
- package/lib/stream-processor.d.ts +2 -1
- package/lib/stream-processor.js.map +1 -1
- package/lib/streams.d.ts +3 -2
- package/lib/streams.js.map +1 -1
- package/package.json +2 -2
package/lib/api-processed.d.ts
CHANGED
|
@@ -1136,11 +1136,11 @@ declare class Bulk extends ShellApiWithMongoClass {
|
|
|
1136
1136
|
/*
|
|
1137
1137
|
Adds a find to the bulk operation.
|
|
1138
1138
|
*/
|
|
1139
|
-
find(query:
|
|
1139
|
+
find(query: MQLQuery): BulkFindOp;
|
|
1140
1140
|
/*
|
|
1141
1141
|
Adds an insert to the bulk operation.
|
|
1142
1142
|
*/
|
|
1143
|
-
insert(document:
|
|
1143
|
+
insert(document: MQLDocument): Bulk;
|
|
1144
1144
|
toJSON(): Record<'nInsertOps' | 'nUpdateOps' | 'nRemoveOps' | 'nBatches', number>;
|
|
1145
1145
|
/*
|
|
1146
1146
|
Returns as a string a JSON document that contains the number of operations and batches in the Bulk() object.
|
|
@@ -2938,17 +2938,17 @@ declare class Collection<M extends GenericServerSideSchema = GenericServerSideSc
|
|
|
2938
2938
|
/*
|
|
2939
2939
|
Calculates aggregate values for the data in a collection or a view.
|
|
2940
2940
|
*/
|
|
2941
|
-
aggregate(pipeline:
|
|
2941
|
+
aggregate(pipeline: MQLPipeline, options: AggregateOptions & {
|
|
2942
2942
|
explain: ExplainVerbosityLike;
|
|
2943
2943
|
}): Document_2;
|
|
2944
2944
|
/*
|
|
2945
2945
|
Calculates aggregate values for the data in a collection or a view.
|
|
2946
2946
|
*/
|
|
2947
|
-
aggregate(pipeline:
|
|
2947
|
+
aggregate(pipeline: MQLPipeline, options?: AggregateOptions): AggregationCursor_2;
|
|
2948
2948
|
/*
|
|
2949
2949
|
Calculates aggregate values for the data in a collection or a view.
|
|
2950
2950
|
*/
|
|
2951
|
-
aggregate(...stages:
|
|
2951
|
+
aggregate(...stages: MQLPipeline): AggregationCursor_2;
|
|
2952
2952
|
/*
|
|
2953
2953
|
Performs multiple write operations with controls for order of execution.
|
|
2954
2954
|
*/
|
|
@@ -2960,7 +2960,7 @@ declare class Collection<M extends GenericServerSideSchema = GenericServerSideSc
|
|
|
2960
2960
|
/*
|
|
2961
2961
|
Returns the count of documents that match the query for a collection or view.
|
|
2962
2962
|
*/
|
|
2963
|
-
countDocuments(query?:
|
|
2963
|
+
countDocuments(query?: MQLQuery, options?: CountDocumentsOptions): number;
|
|
2964
2964
|
/*
|
|
2965
2965
|
Removes all documents that match the filter from a collection.
|
|
2966
2966
|
*/
|
|
@@ -2976,11 +2976,11 @@ declare class Collection<M extends GenericServerSideSchema = GenericServerSideSc
|
|
|
2976
2976
|
/*
|
|
2977
2977
|
Finds the distinct values for a specified field across a single collection or view and returns the results in an array.
|
|
2978
2978
|
*/
|
|
2979
|
-
distinct(field: string, query:
|
|
2979
|
+
distinct(field: string, query: MQLQuery): Document_2;
|
|
2980
2980
|
/*
|
|
2981
2981
|
Finds the distinct values for a specified field across a single collection or view and returns the results in an array.
|
|
2982
2982
|
*/
|
|
2983
|
-
distinct(field: string, query:
|
|
2983
|
+
distinct(field: string, query: MQLQuery, options: DistinctOptions): Document_2;
|
|
2984
2984
|
/*
|
|
2985
2985
|
Returns the count of all documents in a collection or view.
|
|
2986
2986
|
*/
|
|
@@ -2988,7 +2988,7 @@ declare class Collection<M extends GenericServerSideSchema = GenericServerSideSc
|
|
|
2988
2988
|
/*
|
|
2989
2989
|
Selects documents in a collection or view.
|
|
2990
2990
|
*/
|
|
2991
|
-
find(query?:
|
|
2991
|
+
find(query?: MQLQuery, projection?: Document_2, options?: FindOptions): Cursor;
|
|
2992
2992
|
/*
|
|
2993
2993
|
Modifies and returns a single document.
|
|
2994
2994
|
*/
|
|
@@ -2996,7 +2996,7 @@ declare class Collection<M extends GenericServerSideSchema = GenericServerSideSc
|
|
|
2996
2996
|
/*
|
|
2997
2997
|
Selects documents in a collection or view.
|
|
2998
2998
|
*/
|
|
2999
|
-
findOne(query?:
|
|
2999
|
+
findOne(query?: MQLQuery, projection?: Document_2, options?: FindOptions): MQLDocument | null;
|
|
3000
3000
|
/*
|
|
3001
3001
|
Renames a collection.
|
|
3002
3002
|
*/
|
|
@@ -3016,15 +3016,15 @@ declare class Collection<M extends GenericServerSideSchema = GenericServerSideSc
|
|
|
3016
3016
|
/*
|
|
3017
3017
|
Inserts a document or documents into a collection.
|
|
3018
3018
|
*/
|
|
3019
|
-
insert(docs:
|
|
3019
|
+
insert(docs: MQLDocument | MQLDocument[], options?: BulkWriteOptions): InsertManyResult_2;
|
|
3020
3020
|
/*
|
|
3021
3021
|
Inserts multiple documents into a collection.
|
|
3022
3022
|
*/
|
|
3023
|
-
insertMany(docs:
|
|
3023
|
+
insertMany(docs: MQLDocument[], options?: BulkWriteOptions): InsertManyResult_2;
|
|
3024
3024
|
/*
|
|
3025
3025
|
Inserts a document into a collection.
|
|
3026
3026
|
*/
|
|
3027
|
-
insertOne(doc:
|
|
3027
|
+
insertOne(doc: MQLDocument, options?: InsertOneOptions): InsertOneResult_2;
|
|
3028
3028
|
/*
|
|
3029
3029
|
Checks if a collection is capped
|
|
3030
3030
|
*/
|
|
@@ -3032,7 +3032,7 @@ declare class Collection<M extends GenericServerSideSchema = GenericServerSideSc
|
|
|
3032
3032
|
/*
|
|
3033
3033
|
Removes documents from a collection.
|
|
3034
3034
|
*/
|
|
3035
|
-
remove(query:
|
|
3035
|
+
remove(query: MQLQuery, options?: boolean | RemoveShellOptions): DeleteResult_2 | Document_2;
|
|
3036
3036
|
/*
|
|
3037
3037
|
Replaces a single document within the collection based on the filter.
|
|
3038
3038
|
*/
|
|
@@ -3199,7 +3199,7 @@ declare class Collection<M extends GenericServerSideSchema = GenericServerSideSc
|
|
|
3199
3199
|
/*
|
|
3200
3200
|
Opens a change stream cursor on the collection
|
|
3201
3201
|
*/
|
|
3202
|
-
watch(pipeline?:
|
|
3202
|
+
watch(pipeline?: MQLPipeline | ChangeStreamOptions, options?: ChangeStreamOptions): ChangeStreamCursor;
|
|
3203
3203
|
/*
|
|
3204
3204
|
Hides an existing index from the query planner.
|
|
3205
3205
|
*/
|
|
@@ -4726,17 +4726,17 @@ declare class Database<M extends GenericServerSideSchema = GenericServerSideSche
|
|
|
4726
4726
|
/*
|
|
4727
4727
|
Runs a specified admin/diagnostic pipeline which does not require an underlying collection.
|
|
4728
4728
|
*/
|
|
4729
|
-
aggregate(pipeline:
|
|
4729
|
+
aggregate(pipeline: MQLPipeline, options: AggregateOptions & {
|
|
4730
4730
|
explain: ExplainVerbosityLike;
|
|
4731
4731
|
}): Document_2;
|
|
4732
4732
|
/*
|
|
4733
4733
|
Runs a specified admin/diagnostic pipeline which does not require an underlying collection.
|
|
4734
4734
|
*/
|
|
4735
|
-
aggregate(pipeline:
|
|
4735
|
+
aggregate(pipeline: MQLPipeline, options?: AggregateOptions): AggregationCursor_2;
|
|
4736
4736
|
/*
|
|
4737
4737
|
Runs a specified admin/diagnostic pipeline which does not require an underlying collection.
|
|
4738
4738
|
*/
|
|
4739
|
-
aggregate(...stages:
|
|
4739
|
+
aggregate(...stages: MQLPipeline): AggregationCursor_2;
|
|
4740
4740
|
/*
|
|
4741
4741
|
Returns another database without modifying the db variable in the shell environment.
|
|
4742
4742
|
*/
|
|
@@ -4811,7 +4811,7 @@ declare class Database<M extends GenericServerSideSchema = GenericServerSideSche
|
|
|
4811
4811
|
/*
|
|
4812
4812
|
Create new view
|
|
4813
4813
|
*/
|
|
4814
|
-
createView(name: string, source: string, pipeline:
|
|
4814
|
+
createView(name: string, source: string, pipeline: MQLPipeline, options?: CreateCollectionOptions): {
|
|
4815
4815
|
ok: number;
|
|
4816
4816
|
};
|
|
4817
4817
|
/*
|
|
@@ -4990,7 +4990,7 @@ declare class Database<M extends GenericServerSideSchema = GenericServerSideSche
|
|
|
4990
4990
|
/*
|
|
4991
4991
|
Opens a change stream cursor on the database
|
|
4992
4992
|
*/
|
|
4993
|
-
watch(pipeline?:
|
|
4993
|
+
watch(pipeline?: MQLPipeline | ChangeStreamOptions, options?: ChangeStreamOptions): ChangeStreamCursor;
|
|
4994
4994
|
/*
|
|
4995
4995
|
(Experimental) Runs a SQL query against Atlas Data Lake. Note: this is an experimental feature that may be subject to change in future releases.
|
|
4996
4996
|
*/
|
|
@@ -5548,15 +5548,15 @@ declare class Explainable extends ShellApiWithMongoClass {
|
|
|
5548
5548
|
/*
|
|
5549
5549
|
Returns information on the query plan.
|
|
5550
5550
|
*/
|
|
5551
|
-
find(query?:
|
|
5551
|
+
find(query?: MQLQuery, projection?: Document_2, options?: FindOptions): ExplainableCursor_2;
|
|
5552
5552
|
/*
|
|
5553
5553
|
Provides information on the query plan for db.collection.aggregate() method.
|
|
5554
5554
|
*/
|
|
5555
|
-
aggregate(pipeline:
|
|
5555
|
+
aggregate(pipeline: MQLPipeline, options: Document_2): Document_2;
|
|
5556
5556
|
/*
|
|
5557
5557
|
Provides information on the query plan for db.collection.aggregate() method.
|
|
5558
5558
|
*/
|
|
5559
|
-
aggregate(...stages:
|
|
5559
|
+
aggregate(...stages: MQLPipeline): Document_2;
|
|
5560
5560
|
/*
|
|
5561
5561
|
Returns information on the query plan for db.collection.count().
|
|
5562
5562
|
*/
|
|
@@ -5568,11 +5568,11 @@ declare class Explainable extends ShellApiWithMongoClass {
|
|
|
5568
5568
|
/*
|
|
5569
5569
|
Returns information on the query plan for db.collection.distinct().
|
|
5570
5570
|
*/
|
|
5571
|
-
distinct(field: string, query:
|
|
5571
|
+
distinct(field: string, query: MQLQuery): Document_2;
|
|
5572
5572
|
/*
|
|
5573
5573
|
Returns information on the query plan for db.collection.distinct().
|
|
5574
5574
|
*/
|
|
5575
|
-
distinct(field: string, query:
|
|
5575
|
+
distinct(field: string, query: MQLQuery, options: DistinctOptions): Document_2;
|
|
5576
5576
|
/*
|
|
5577
5577
|
Returns information on the query plan for db.collection.findAndModify().
|
|
5578
5578
|
*/
|
|
@@ -5580,19 +5580,19 @@ declare class Explainable extends ShellApiWithMongoClass {
|
|
|
5580
5580
|
/*
|
|
5581
5581
|
Returns information on the query plan for db.collection.findOneAndDelete().
|
|
5582
5582
|
*/
|
|
5583
|
-
findOneAndDelete(filter:
|
|
5583
|
+
findOneAndDelete(filter: MQLQuery, options?: FindOneAndDeleteOptions): Document_2 | null;
|
|
5584
5584
|
/*
|
|
5585
5585
|
Returns information on the query plan for db.collection.findOneAndReplace().
|
|
5586
5586
|
*/
|
|
5587
|
-
findOneAndReplace(filter:
|
|
5587
|
+
findOneAndReplace(filter: MQLQuery, replacement: MQLDocument, options?: FindAndModifyShellOptions<FindOneAndReplaceOptions>): Document_2;
|
|
5588
5588
|
/*
|
|
5589
5589
|
Returns information on the query plan for db.collection.findOneAndUpdate().
|
|
5590
5590
|
*/
|
|
5591
|
-
findOneAndUpdate(filter:
|
|
5591
|
+
findOneAndUpdate(filter: MQLQuery, update: MQLDocument, options?: FindAndModifyShellOptions<FindOneAndUpdateOptions>): Document_2;
|
|
5592
5592
|
/*
|
|
5593
5593
|
Returns information on the query plan for db.collection.remove().
|
|
5594
5594
|
*/
|
|
5595
|
-
remove(query:
|
|
5595
|
+
remove(query: MQLQuery, options?: boolean | RemoveShellOptions): Document_2;
|
|
5596
5596
|
/*
|
|
5597
5597
|
Returns information on the query plan for db.collection.update().
|
|
5598
5598
|
*/
|
|
@@ -5758,7 +5758,7 @@ declare interface FilterOperators<TValue> extends NonObjectIdLikeDocument {
|
|
|
5758
5758
|
$rand?: Record<string, never>;
|
|
5759
5759
|
}
|
|
5760
5760
|
declare type FindAndModifyMethodShellOptions = {
|
|
5761
|
-
query:
|
|
5761
|
+
query: MQLQuery;
|
|
5762
5762
|
sort?: (FindOneAndDeleteOptions | FindOneAndReplaceOptions | FindOneAndUpdateOptions)['sort'];
|
|
5763
5763
|
update?: Document_2 | Document_2[];
|
|
5764
5764
|
remove?: boolean;
|
|
@@ -6806,7 +6806,7 @@ export declare class Mongo<M extends GenericServerSideSchema = GenericServerSide
|
|
|
6806
6806
|
/*
|
|
6807
6807
|
Opens a change stream cursor on the connection
|
|
6808
6808
|
*/
|
|
6809
|
-
watch(pipeline?:
|
|
6809
|
+
watch(pipeline?: MQLPipeline | ChangeStreamOptions, options?: ChangeStreamOptions): ChangeStreamCursor;
|
|
6810
6810
|
/*
|
|
6811
6811
|
Returns the ClientEncryption object for the current database collection. The ClientEncryption object supports explicit (manual) encryption and decryption of field values for Client-Side field level encryption.
|
|
6812
6812
|
*/
|
|
@@ -7809,6 +7809,9 @@ declare interface MongoshBusEventsMap extends ConnectEventMap {
|
|
|
7809
7809
|
'mongosh:fetching-update-metadata-complete': (ev: FetchingUpdateMetadataCompleteEvent) => void;
|
|
7810
7810
|
'mongosh:log-initialized': () => void;
|
|
7811
7811
|
}
|
|
7812
|
+
declare type MQLDocument = Document_2;
|
|
7813
|
+
declare type MQLPipeline = Document_2[];
|
|
7814
|
+
declare type MQLQuery = Document_2;
|
|
7812
7815
|
declare interface Namespace {
|
|
7813
7816
|
db: string;
|
|
7814
7817
|
collection: string;
|
|
@@ -7997,11 +8000,11 @@ declare class PlanCache extends ShellApiWithMongoClass {
|
|
|
7997
8000
|
/*
|
|
7998
8001
|
Removes cached query plan(s) for a collection of the specified query shape.
|
|
7999
8002
|
*/
|
|
8000
|
-
clearPlansByQuery(query:
|
|
8003
|
+
clearPlansByQuery(query: MQLQuery, projection?: Document_2, sort?: Document_2): Document_2;
|
|
8001
8004
|
/*
|
|
8002
8005
|
Lists cached query plan(s) for a collection.
|
|
8003
8006
|
*/
|
|
8004
|
-
list(pipeline?:
|
|
8007
|
+
list(pipeline?: MQLPipeline): Document_2[];
|
|
8005
8008
|
/*
|
|
8006
8009
|
Deprecated. Please use PlanCache.list instead
|
|
8007
8010
|
*/
|
|
@@ -9051,15 +9054,15 @@ export declare class Shard<M extends GenericServerSideSchema = GenericServerSide
|
|
|
9051
9054
|
/*
|
|
9052
9055
|
Divides an existing chunk into two chunks using a specific value of the shard key as the dividing point. Uses the split command
|
|
9053
9056
|
*/
|
|
9054
|
-
splitAt(ns: string, query:
|
|
9057
|
+
splitAt(ns: string, query: MQLQuery): Document_2;
|
|
9055
9058
|
/*
|
|
9056
9059
|
Splits a chunk at the shard key value specified by the query at the median. Uses the split command
|
|
9057
9060
|
*/
|
|
9058
|
-
splitFind(ns: string, query:
|
|
9061
|
+
splitFind(ns: string, query: MQLQuery): Document_2;
|
|
9059
9062
|
/*
|
|
9060
9063
|
Moves the chunk that contains the document specified by the query to the destination shard. Uses the moveChunk command
|
|
9061
9064
|
*/
|
|
9062
|
-
moveChunk(ns: string, query:
|
|
9065
|
+
moveChunk(ns: string, query: MQLQuery, destination: string): Document_2;
|
|
9063
9066
|
/*
|
|
9064
9067
|
Moves a range of documents specified by the min and max keys to the destination shard. Uses the moveRange command
|
|
9065
9068
|
*/
|
|
@@ -9579,7 +9582,7 @@ declare class StreamProcessor extends ShellApiWithMongoClass {
|
|
|
9579
9582
|
/*
|
|
9580
9583
|
Modify a stream processor definition.
|
|
9581
9584
|
*/
|
|
9582
|
-
modify(pipeline:
|
|
9585
|
+
modify(pipeline: MQLPipeline, options?: Document_2): Document_2;
|
|
9583
9586
|
/*
|
|
9584
9587
|
Return a sample of the results from a named stream processor.
|
|
9585
9588
|
*/
|
|
@@ -9599,11 +9602,11 @@ export declare class Streams<M extends GenericServerSideSchema = GenericServerSi
|
|
|
9599
9602
|
/*
|
|
9600
9603
|
Allows a user to process streams of data in the shell interactively and quickly iterate building a stream processor as they go.
|
|
9601
9604
|
*/
|
|
9602
|
-
process(pipeline:
|
|
9605
|
+
process(pipeline: MQLPipeline, options?: Document_2): void | Document_2;
|
|
9603
9606
|
/*
|
|
9604
9607
|
Create a named stream processor.
|
|
9605
9608
|
*/
|
|
9606
|
-
createStreamProcessor(name: string, pipeline:
|
|
9609
|
+
createStreamProcessor(name: string, pipeline: MQLPipeline, options?: Document_2): Document_2 | StreamProcessor;
|
|
9607
9610
|
/*
|
|
9608
9611
|
Show a list of all the named stream processors.
|
|
9609
9612
|
*/
|
package/lib/api-raw.d.ts
CHANGED
|
@@ -1127,8 +1127,8 @@ declare class Bulk extends ShellApiWithMongoClass {
|
|
|
1127
1127
|
[asPrintable](): any;
|
|
1128
1128
|
private _emitBulkApiCall;
|
|
1129
1129
|
execute(writeConcern?: WriteConcern): Promise<BulkWriteResult_2>;
|
|
1130
|
-
find(query:
|
|
1131
|
-
insert(document:
|
|
1130
|
+
find(query: MQLQuery): BulkFindOp;
|
|
1131
|
+
insert(document: MQLDocument): Bulk;
|
|
1132
1132
|
toJSON(): Record<'nInsertOps' | 'nUpdateOps' | 'nRemoveOps' | 'nBatches', number>;
|
|
1133
1133
|
toString(): string;
|
|
1134
1134
|
getOperations(): Pick<Batch, 'originalZeroIndex' | 'batchType' | 'operations'>[];
|
|
@@ -2854,32 +2854,32 @@ declare class Collection<M extends GenericServerSideSchema = GenericServerSideSc
|
|
|
2854
2854
|
[namespaceInfo](): Namespace;
|
|
2855
2855
|
[asPrintable](): string;
|
|
2856
2856
|
private _emitCollectionApiCall;
|
|
2857
|
-
aggregate(pipeline:
|
|
2857
|
+
aggregate(pipeline: MQLPipeline, options: AggregateOptions & {
|
|
2858
2858
|
explain: ExplainVerbosityLike;
|
|
2859
2859
|
}): Promise<Document_2>;
|
|
2860
|
-
aggregate(pipeline:
|
|
2861
|
-
aggregate(...stages:
|
|
2860
|
+
aggregate(pipeline: MQLPipeline, options?: AggregateOptions): Promise<AggregationCursor_2>;
|
|
2861
|
+
aggregate(...stages: MQLPipeline): Promise<AggregationCursor_2>;
|
|
2862
2862
|
bulkWrite(operations: AnyBulkWriteOperation[], options?: BulkWriteOptions): Promise<BulkWriteResult_2>;
|
|
2863
2863
|
count(query?: {}, options?: CountOptions): Promise<number>;
|
|
2864
|
-
countDocuments(query?:
|
|
2864
|
+
countDocuments(query?: MQLQuery, options?: CountDocumentsOptions): Promise<number>;
|
|
2865
2865
|
deleteMany(filter: Document_2, options?: DeleteOptions): Promise<DeleteResult_2 | Document_2>;
|
|
2866
2866
|
deleteOne(filter: Document_2, options?: DeleteOptions): Promise<DeleteResult_2 | Document_2>;
|
|
2867
2867
|
distinct(field: string): Promise<Document_2>;
|
|
2868
|
-
distinct(field: string, query:
|
|
2869
|
-
distinct(field: string, query:
|
|
2868
|
+
distinct(field: string, query: MQLQuery): Promise<Document_2>;
|
|
2869
|
+
distinct(field: string, query: MQLQuery, options: DistinctOptions): Promise<Document_2>;
|
|
2870
2870
|
estimatedDocumentCount(options?: EstimatedDocumentCountOptions): Promise<number>;
|
|
2871
|
-
find(query?:
|
|
2871
|
+
find(query?: MQLQuery, projection?: Document_2, options?: FindOptions): Promise<Cursor>;
|
|
2872
2872
|
findAndModify(options: FindAndModifyMethodShellOptions): Promise<Document_2 | null>;
|
|
2873
|
-
findOne(query?:
|
|
2873
|
+
findOne(query?: MQLQuery, projection?: Document_2, options?: FindOptions): Promise<MQLDocument | null>;
|
|
2874
2874
|
renameCollection(newName: string, dropTarget?: boolean): Promise<Document_2>;
|
|
2875
2875
|
findOneAndDelete(filter: Document_2, options?: FindOneAndDeleteOptions): Promise<Document_2 | null>;
|
|
2876
2876
|
findOneAndReplace(filter: Document_2, replacement: Document_2, options?: FindAndModifyShellOptions<FindOneAndReplaceOptions>): Promise<Document_2>;
|
|
2877
2877
|
findOneAndUpdate(filter: Document_2, update: Document_2 | Document_2[], options?: FindAndModifyShellOptions<FindOneAndUpdateOptions>): Promise<Document_2>;
|
|
2878
|
-
insert(docs:
|
|
2879
|
-
insertMany(docs:
|
|
2880
|
-
insertOne(doc:
|
|
2878
|
+
insert(docs: MQLDocument | MQLDocument[], options?: BulkWriteOptions): Promise<InsertManyResult_2>;
|
|
2879
|
+
insertMany(docs: MQLDocument[], options?: BulkWriteOptions): Promise<InsertManyResult_2>;
|
|
2880
|
+
insertOne(doc: MQLDocument, options?: InsertOneOptions): Promise<InsertOneResult_2>;
|
|
2881
2881
|
isCapped(): Promise<boolean>;
|
|
2882
|
-
remove(query:
|
|
2882
|
+
remove(query: MQLQuery, options?: boolean | RemoveShellOptions): Promise<DeleteResult_2 | Document_2>;
|
|
2883
2883
|
replaceOne(filter: Document_2, replacement: Document_2, options?: ReplaceOptions): Promise<UpdateResult_2>;
|
|
2884
2884
|
update(filter: Document_2, update: Document_2, options?: UpdateOptions & {
|
|
2885
2885
|
multi?: boolean;
|
|
@@ -2929,7 +2929,7 @@ declare class Collection<M extends GenericServerSideSchema = GenericServerSideSc
|
|
|
2929
2929
|
shards: string[];
|
|
2930
2930
|
sharded: boolean;
|
|
2931
2931
|
}>;
|
|
2932
|
-
watch(pipeline?:
|
|
2932
|
+
watch(pipeline?: MQLPipeline | ChangeStreamOptions, options?: ChangeStreamOptions): Promise<ChangeStreamCursor>;
|
|
2933
2933
|
hideIndex(index: string | Document_2): Promise<Document_2>;
|
|
2934
2934
|
unhideIndex(index: string | Document_2): Promise<Document_2>;
|
|
2935
2935
|
analyzeShardKey(key: Document_2, options?: Document_2): Promise<Document_2>;
|
|
@@ -4359,11 +4359,11 @@ declare class Database<M extends GenericServerSideSchema = GenericServerSideSche
|
|
|
4359
4359
|
getCollectionInfos(filter?: Document_2, options?: ListCollectionsOptions): Promise<Document_2[]>;
|
|
4360
4360
|
runCommand(cmd: string | Document_2, options?: RunCommandOptions): Promise<Document_2>;
|
|
4361
4361
|
adminCommand(cmd: string | Document_2): Promise<Document_2>;
|
|
4362
|
-
aggregate(pipeline:
|
|
4362
|
+
aggregate(pipeline: MQLPipeline, options: AggregateOptions & {
|
|
4363
4363
|
explain: ExplainVerbosityLike;
|
|
4364
4364
|
}): Promise<Document_2>;
|
|
4365
|
-
aggregate(pipeline:
|
|
4366
|
-
aggregate(...stages:
|
|
4365
|
+
aggregate(pipeline: MQLPipeline, options?: AggregateOptions): Promise<AggregationCursor_2>;
|
|
4366
|
+
aggregate(...stages: MQLPipeline): Promise<AggregationCursor_2>;
|
|
4367
4367
|
getSiblingDB<K extends StringKey<M>>(db: K): DatabaseWithSchema<M, M[K]>;
|
|
4368
4368
|
getCollection<K extends StringKey<D>>(coll: K): CollectionWithSchema<M, D, D[K], K>;
|
|
4369
4369
|
dropDatabase(writeConcern?: WriteConcern): Promise<Document_2>;
|
|
@@ -4387,7 +4387,7 @@ declare class Database<M extends GenericServerSideSchema = GenericServerSideSche
|
|
|
4387
4387
|
collection: Collection;
|
|
4388
4388
|
encryptedFields: Document_2;
|
|
4389
4389
|
}>;
|
|
4390
|
-
createView(name: string, source: string, pipeline:
|
|
4390
|
+
createView(name: string, source: string, pipeline: MQLPipeline, options?: CreateCollectionOptions): Promise<{
|
|
4391
4391
|
ok: number;
|
|
4392
4392
|
}>;
|
|
4393
4393
|
createRole(role: Document_2, writeConcern?: WriteConcern): Promise<Document_2>;
|
|
@@ -4434,7 +4434,7 @@ declare class Database<M extends GenericServerSideSchema = GenericServerSideSche
|
|
|
4434
4434
|
printReplicationInfo(): Promise<CommandResult>;
|
|
4435
4435
|
printSlaveReplicationInfo(): never;
|
|
4436
4436
|
setSecondaryOk(): Promise<void>;
|
|
4437
|
-
watch(pipeline?:
|
|
4437
|
+
watch(pipeline?: MQLPipeline | ChangeStreamOptions, options?: ChangeStreamOptions): Promise<ChangeStreamCursor>;
|
|
4438
4438
|
sql(sqlString: string, options?: AggregateOptions): Promise<AggregationCursor_2>;
|
|
4439
4439
|
checkMetadataConsistency(options?: CheckMetadataConsistencyOptions): Promise<RunCommandCursor_2>;
|
|
4440
4440
|
}
|
|
@@ -4989,18 +4989,18 @@ declare class Explainable extends ShellApiWithMongoClass {
|
|
|
4989
4989
|
getCollection(): CollectionWithSchema;
|
|
4990
4990
|
getVerbosity(): ExplainVerbosityLike;
|
|
4991
4991
|
setVerbosity(verbosity: ExplainVerbosityLike): void;
|
|
4992
|
-
find(query?:
|
|
4993
|
-
aggregate(pipeline:
|
|
4994
|
-
aggregate(...stages:
|
|
4992
|
+
find(query?: MQLQuery, projection?: Document_2, options?: FindOptions): Promise<ExplainableCursor_2>;
|
|
4993
|
+
aggregate(pipeline: MQLPipeline, options: Document_2): Promise<Document_2>;
|
|
4994
|
+
aggregate(...stages: MQLPipeline): Promise<Document_2>;
|
|
4995
4995
|
count(query?: {}, options?: CountOptions): Promise<Document_2>;
|
|
4996
4996
|
distinct(field: string): Promise<Document_2>;
|
|
4997
|
-
distinct(field: string, query:
|
|
4998
|
-
distinct(field: string, query:
|
|
4997
|
+
distinct(field: string, query: MQLQuery): Promise<Document_2>;
|
|
4998
|
+
distinct(field: string, query: MQLQuery, options: DistinctOptions): Promise<Document_2>;
|
|
4999
4999
|
findAndModify(options: FindAndModifyMethodShellOptions): Promise<Document_2 | null>;
|
|
5000
|
-
findOneAndDelete(filter:
|
|
5001
|
-
findOneAndReplace(filter:
|
|
5002
|
-
findOneAndUpdate(filter:
|
|
5003
|
-
remove(query:
|
|
5000
|
+
findOneAndDelete(filter: MQLQuery, options?: FindOneAndDeleteOptions): Promise<Document_2 | null>;
|
|
5001
|
+
findOneAndReplace(filter: MQLQuery, replacement: MQLDocument, options?: FindAndModifyShellOptions<FindOneAndReplaceOptions>): Promise<Document_2>;
|
|
5002
|
+
findOneAndUpdate(filter: MQLQuery, update: MQLDocument, options?: FindAndModifyShellOptions<FindOneAndUpdateOptions>): Promise<Document_2>;
|
|
5003
|
+
remove(query: MQLQuery, options?: boolean | RemoveShellOptions): Promise<Document_2>;
|
|
5004
5004
|
update(filter: Document_2, update: Document_2, options?: UpdateOptions): Promise<Document_2>;
|
|
5005
5005
|
mapReduce(map: Function | string, reduce: Function | string, optionsOrOutString: MapReduceShellOptions): Promise<Document_2>;
|
|
5006
5006
|
}
|
|
@@ -5168,7 +5168,7 @@ declare interface FilterOperators<TValue> extends NonObjectIdLikeDocument {
|
|
|
5168
5168
|
}
|
|
5169
5169
|
|
|
5170
5170
|
declare type FindAndModifyMethodShellOptions = {
|
|
5171
|
-
query:
|
|
5171
|
+
query: MQLQuery;
|
|
5172
5172
|
sort?: (FindOneAndDeleteOptions | FindOneAndReplaceOptions | FindOneAndUpdateOptions)['sort'];
|
|
5173
5173
|
update?: Document_2 | Document_2[];
|
|
5174
5174
|
remove?: boolean;
|
|
@@ -6133,7 +6133,7 @@ export declare class Mongo<M extends GenericServerSideSchema = GenericServerSide
|
|
|
6133
6133
|
isCausalConsistency(): void;
|
|
6134
6134
|
setSlaveOk(): void;
|
|
6135
6135
|
setSecondaryOk(): Promise<void>;
|
|
6136
|
-
watch(pipeline?:
|
|
6136
|
+
watch(pipeline?: MQLPipeline | ChangeStreamOptions, options?: ChangeStreamOptions): Promise<ChangeStreamCursor>;
|
|
6137
6137
|
getClientEncryption(): ClientEncryption_2;
|
|
6138
6138
|
getKeyVault(): Promise<KeyVault>;
|
|
6139
6139
|
convertShardKeyToHashed(value: any): Promise<unknown>;
|
|
@@ -7130,6 +7130,12 @@ declare interface MongoshBusEventsMap extends ConnectEventMap {
|
|
|
7130
7130
|
'mongosh:log-initialized': () => void;
|
|
7131
7131
|
}
|
|
7132
7132
|
|
|
7133
|
+
declare type MQLDocument = Document_2;
|
|
7134
|
+
|
|
7135
|
+
declare type MQLPipeline = Document_2[];
|
|
7136
|
+
|
|
7137
|
+
declare type MQLQuery = Document_2;
|
|
7138
|
+
|
|
7133
7139
|
declare interface Namespace {
|
|
7134
7140
|
db: string;
|
|
7135
7141
|
collection: string;
|
|
@@ -7319,8 +7325,8 @@ declare class PlanCache extends ShellApiWithMongoClass {
|
|
|
7319
7325
|
get _mongo(): Mongo;
|
|
7320
7326
|
[asPrintable](): string;
|
|
7321
7327
|
clear(): Promise<Document_2>;
|
|
7322
|
-
clearPlansByQuery(query:
|
|
7323
|
-
list(pipeline?:
|
|
7328
|
+
clearPlansByQuery(query: MQLQuery, projection?: Document_2, sort?: Document_2): Promise<Document_2>;
|
|
7329
|
+
list(pipeline?: MQLPipeline): Promise<Document_2[]>;
|
|
7324
7330
|
listQueryShapes(): never;
|
|
7325
7331
|
getPlansByQuery(): never;
|
|
7326
7332
|
}
|
|
@@ -8248,9 +8254,9 @@ export declare class Shard<M extends GenericServerSideSchema = GenericServerSide
|
|
|
8248
8254
|
removeShardTag(shard: string, tag: string): Promise<Document_2>;
|
|
8249
8255
|
enableAutoSplit(): Promise<UpdateResult_2>;
|
|
8250
8256
|
disableAutoSplit(): Promise<UpdateResult_2>;
|
|
8251
|
-
splitAt(ns: string, query:
|
|
8252
|
-
splitFind(ns: string, query:
|
|
8253
|
-
moveChunk(ns: string, query:
|
|
8257
|
+
splitAt(ns: string, query: MQLQuery): Promise<Document_2>;
|
|
8258
|
+
splitFind(ns: string, query: MQLQuery): Promise<Document_2>;
|
|
8259
|
+
moveChunk(ns: string, query: MQLQuery, destination: string): Promise<Document_2>;
|
|
8254
8260
|
moveRange(ns: string, toShard: string, min?: Document_2, max?: Document_2): Promise<Document_2>;
|
|
8255
8261
|
balancerCollectionStatus(ns: string): Promise<Document_2>;
|
|
8256
8262
|
enableBalancing(ns: string): Promise<UpdateResult_2>;
|
|
@@ -8625,7 +8631,7 @@ declare class StreamProcessor extends ShellApiWithMongoClass {
|
|
|
8625
8631
|
_drop(options?: Document_2): Promise<Document_2>;
|
|
8626
8632
|
stats(options?: Document_2): Promise<Document_2>;
|
|
8627
8633
|
modify(options: Document_2): Promise<Document_2>;
|
|
8628
|
-
modify(pipeline:
|
|
8634
|
+
modify(pipeline: MQLPipeline, options?: Document_2): Promise<Document_2>;
|
|
8629
8635
|
sample(options?: Document_2): Promise<Document_2 | undefined>;
|
|
8630
8636
|
_sampleFrom(cursorId: number): Promise<Document_2 | undefined>;
|
|
8631
8637
|
}
|
|
@@ -8637,8 +8643,8 @@ export declare class Streams<M extends GenericServerSideSchema = GenericServerSi
|
|
|
8637
8643
|
get _mongo(): Mongo<M>;
|
|
8638
8644
|
[asPrintable](): string;
|
|
8639
8645
|
getProcessor(name: string): StreamProcessor;
|
|
8640
|
-
process(pipeline:
|
|
8641
|
-
createStreamProcessor(name: string, pipeline:
|
|
8646
|
+
process(pipeline: MQLPipeline, options?: Document_2): Promise<void | Document_2>;
|
|
8647
|
+
createStreamProcessor(name: string, pipeline: MQLPipeline, options?: Document_2): Promise<Document_2 | StreamProcessor>;
|
|
8642
8648
|
listStreamProcessors(filter: Document_2): Promise<any>;
|
|
8643
8649
|
listConnections(filter: Document_2): Promise<any>;
|
|
8644
8650
|
_runStreamCommand(cmd: Document_2, options?: Document_2): Promise<Document_2>;
|
package/lib/bulk.d.ts
CHANGED
|
@@ -4,6 +4,7 @@ import type { Batch, Document, WriteConcern, OrderedBulkOperation, UnorderedBulk
|
|
|
4
4
|
import { asPrintable } from './enums';
|
|
5
5
|
import { BulkWriteResult } from './result';
|
|
6
6
|
import type { CollectionWithSchema } from './collection';
|
|
7
|
+
import type { MQLDocument, MQLQuery } from './mql-types';
|
|
7
8
|
export declare class BulkFindOp extends ShellApiWithMongoClass {
|
|
8
9
|
_serviceProviderBulkFindOp: FindOperators;
|
|
9
10
|
_parentBulk: Bulk;
|
|
@@ -33,8 +34,8 @@ export default class Bulk extends ShellApiWithMongoClass {
|
|
|
33
34
|
[asPrintable](): any;
|
|
34
35
|
private _emitBulkApiCall;
|
|
35
36
|
execute(writeConcern?: WriteConcern): Promise<BulkWriteResult>;
|
|
36
|
-
find(query:
|
|
37
|
-
insert(document:
|
|
37
|
+
find(query: MQLQuery): BulkFindOp;
|
|
38
|
+
insert(document: MQLDocument): Bulk;
|
|
38
39
|
toJSON(): Record<'nInsertOps' | 'nUpdateOps' | 'nRemoveOps' | 'nBatches', number>;
|
|
39
40
|
toString(): string;
|
|
40
41
|
getOperations(): Pick<Batch, 'originalZeroIndex' | 'batchType' | 'operations'>[];
|
package/lib/bulk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"bulk.js","sourceRoot":"","sources":["../src/bulk.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAOsB;AAEtB,4CAAyE;AAUzE,mCAAsC;AACtC,uCAAgE;AAChE,qCAA2C;
|
|
1
|
+
{"version":3,"file":"bulk.js","sourceRoot":"","sources":["../src/bulk.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6CAOsB;AAEtB,4CAAyE;AAUzE,mCAAsC;AACtC,uCAAgE;AAChE,qCAA2C;IAK9B,UAAU;4BADtB,iCAAoB;;;;sBACW,mCAAsB;;;;;;;;;;;;;uCAA9B,SAAQ,WAAsB;QAGpD,YAAY,SAAwB,EAAE,UAAgB;YACpD,KAAK,EAAE,CAAC;YAHV,+BAA0B,GADf,mDAAU,CACqB;YAIxC,IAAI,CAAC,0BAA0B,GAAG,SAAS,CAAC;YAC5C,IAAI,CAAC,WAAW,GAAG,UAAU,CAAC;QAChC,CAAC;QAED,IAAI,MAAM;YACR,OAAO,IAAI,CAAC,WAAW,CAAC,MAAM,CAAC;QACjC,CAAC;QAED,CAAC,mBAAW,CAAC;YACX,OAAO,YAAY,CAAC;QACtB,CAAC;QAID,SAAS,CAAC,IAAsB;YAC9B,IAAI,CAAC,0BAA0B,CAAC,SAAS,CAAC,IAAI,CAAC,CAAC;YAChD,O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QAID,2KAAA,MAAM,6DAKL;QArFH,6KAuHC;;;QAvHoB,uDAAI"}
|
package/lib/collection.d.ts
CHANGED
|
@@ -9,6 +9,7 @@ import { AggregationCursor, BulkWriteResult, CommandResult, Cursor, DeleteResult
|
|
|
9
9
|
import Bulk from './bulk';
|
|
10
10
|
import PlanCache from './plan-cache';
|
|
11
11
|
import ChangeStreamCursor from './change-stream-cursor';
|
|
12
|
+
import type { MQLDocument, MQLQuery, MQLPipeline } from './mql-types';
|
|
12
13
|
export type CollectionWithSchema<M extends GenericServerSideSchema = GenericServerSideSchema, D extends GenericDatabaseSchema = M[keyof M], C extends GenericCollectionSchema = D[keyof D], N extends StringKey<D> = StringKey<D>> = Collection<M, D, C, N> & {
|
|
13
14
|
[k in StringKey<D> as k extends `${N}.${infer S}` ? S : never]: Collection<M, D, D[k], k>;
|
|
14
15
|
};
|
|
@@ -21,32 +22,32 @@ export declare class Collection<M extends GenericServerSideSchema = GenericServe
|
|
|
21
22
|
[namespaceInfo](): Namespace;
|
|
22
23
|
[asPrintable](): string;
|
|
23
24
|
private _emitCollectionApiCall;
|
|
24
|
-
aggregate(pipeline:
|
|
25
|
+
aggregate(pipeline: MQLPipeline, options: AggregateOptions & {
|
|
25
26
|
explain: ExplainVerbosityLike;
|
|
26
27
|
}): Promise<Document>;
|
|
27
|
-
aggregate(pipeline:
|
|
28
|
-
aggregate(...stages:
|
|
28
|
+
aggregate(pipeline: MQLPipeline, options?: AggregateOptions): Promise<AggregationCursor>;
|
|
29
|
+
aggregate(...stages: MQLPipeline): Promise<AggregationCursor>;
|
|
29
30
|
bulkWrite(operations: AnyBulkWriteOperation[], options?: BulkWriteOptions): Promise<BulkWriteResult>;
|
|
30
31
|
count(query?: {}, options?: CountOptions): Promise<number>;
|
|
31
|
-
countDocuments(query?:
|
|
32
|
+
countDocuments(query?: MQLQuery, options?: CountDocumentsOptions): Promise<number>;
|
|
32
33
|
deleteMany(filter: Document, options?: DeleteOptions): Promise<DeleteResult | Document>;
|
|
33
34
|
deleteOne(filter: Document, options?: DeleteOptions): Promise<DeleteResult | Document>;
|
|
34
35
|
distinct(field: string): Promise<Document>;
|
|
35
|
-
distinct(field: string, query:
|
|
36
|
-
distinct(field: string, query:
|
|
36
|
+
distinct(field: string, query: MQLQuery): Promise<Document>;
|
|
37
|
+
distinct(field: string, query: MQLQuery, options: DistinctOptions): Promise<Document>;
|
|
37
38
|
estimatedDocumentCount(options?: EstimatedDocumentCountOptions): Promise<number>;
|
|
38
|
-
find(query?:
|
|
39
|
+
find(query?: MQLQuery, projection?: Document, options?: FindOptions): Promise<Cursor>;
|
|
39
40
|
findAndModify(options: FindAndModifyMethodShellOptions): Promise<Document | null>;
|
|
40
|
-
findOne(query?:
|
|
41
|
+
findOne(query?: MQLQuery, projection?: Document, options?: FindOptions): Promise<MQLDocument | null>;
|
|
41
42
|
renameCollection(newName: string, dropTarget?: boolean): Promise<Document>;
|
|
42
43
|
findOneAndDelete(filter: Document, options?: FindOneAndDeleteOptions): Promise<Document | null>;
|
|
43
44
|
findOneAndReplace(filter: Document, replacement: Document, options?: FindAndModifyShellOptions<FindOneAndReplaceOptions>): Promise<Document>;
|
|
44
45
|
findOneAndUpdate(filter: Document, update: Document | Document[], options?: FindAndModifyShellOptions<FindOneAndUpdateOptions>): Promise<Document>;
|
|
45
|
-
insert(docs:
|
|
46
|
-
insertMany(docs:
|
|
47
|
-
insertOne(doc:
|
|
46
|
+
insert(docs: MQLDocument | MQLDocument[], options?: BulkWriteOptions): Promise<InsertManyResult>;
|
|
47
|
+
insertMany(docs: MQLDocument[], options?: BulkWriteOptions): Promise<InsertManyResult>;
|
|
48
|
+
insertOne(doc: MQLDocument, options?: InsertOneOptions): Promise<InsertOneResult>;
|
|
48
49
|
isCapped(): Promise<boolean>;
|
|
49
|
-
remove(query:
|
|
50
|
+
remove(query: MQLQuery, options?: boolean | RemoveShellOptions): Promise<DeleteResult | Document>;
|
|
50
51
|
replaceOne(filter: Document, replacement: Document, options?: ReplaceOptions): Promise<UpdateResult>;
|
|
51
52
|
update(filter: Document, update: Document, options?: UpdateOptions & {
|
|
52
53
|
multi?: boolean;
|
|
@@ -96,7 +97,7 @@ export declare class Collection<M extends GenericServerSideSchema = GenericServe
|
|
|
96
97
|
shards: string[];
|
|
97
98
|
sharded: boolean;
|
|
98
99
|
}>;
|
|
99
|
-
watch(pipeline?:
|
|
100
|
+
watch(pipeline?: MQLPipeline | ChangeStreamOptions, options?: ChangeStreamOptions): Promise<ChangeStreamCursor>;
|
|
100
101
|
hideIndex(index: string | Document): Promise<Document>;
|
|
101
102
|
unhideIndex(index: string | Document): Promise<Document>;
|
|
102
103
|
analyzeShardKey(key: Document, options?: Document): Promise<Document>;
|