@qp-mongosh/shell-api 0.0.0-dev.5 → 0.0.0-dev.9

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 (66) hide show
  1. package/.eslintignore +2 -2
  2. package/.eslintrc.js +1 -1
  3. package/AUTHORS +15 -15
  4. package/LICENSE +200 -200
  5. package/bin/report-missing-help.ts +24 -24
  6. package/bin/report-supported-api.ts +14 -14
  7. package/lib/abstract-cursor.d.ts +33 -33
  8. package/lib/abstract-cursor.js +191 -191
  9. package/lib/aggregation-cursor.d.ts +6 -6
  10. package/lib/aggregation-cursor.js +19 -19
  11. package/lib/bulk.d.ts +43 -43
  12. package/lib/bulk.js +223 -223
  13. package/lib/change-stream-cursor.d.ts +28 -28
  14. package/lib/change-stream-cursor.js +111 -111
  15. package/lib/collection.d.ts +95 -95
  16. package/lib/collection.js +964 -964
  17. package/lib/cursor.d.ts +32 -32
  18. package/lib/cursor.js +215 -215
  19. package/lib/database.d.ts +116 -116
  20. package/lib/database.js +1223 -1223
  21. package/lib/dbquery.d.ts +8 -8
  22. package/lib/dbquery.js +28 -28
  23. package/lib/decorators.d.ts +73 -73
  24. package/lib/decorators.js +395 -395
  25. package/lib/enums.d.ts +28 -28
  26. package/lib/enums.js +33 -33
  27. package/lib/error-codes.d.ts +12 -12
  28. package/lib/error-codes.js +19 -19
  29. package/lib/explainable-cursor.d.ts +11 -11
  30. package/lib/explainable-cursor.js +31 -31
  31. package/lib/explainable.d.ts +32 -32
  32. package/lib/explainable.js +166 -166
  33. package/lib/field-level-encryption.d.ts +50 -50
  34. package/lib/field-level-encryption.js +176 -176
  35. package/lib/help.d.ts +22 -22
  36. package/lib/help.js +26 -26
  37. package/lib/helpers.d.ts +71 -71
  38. package/lib/helpers.js +588 -588
  39. package/lib/index.d.ts +16 -16
  40. package/lib/index.js +45 -45
  41. package/lib/interruptor.d.ts +19 -19
  42. package/lib/interruptor.js +62 -62
  43. package/lib/mongo-errors.d.ts +5 -5
  44. package/lib/mongo-errors.js +37 -37
  45. package/lib/mongo.d.ts +75 -75
  46. package/lib/mongo.js +476 -476
  47. package/lib/no-db.d.ts +5 -5
  48. package/lib/no-db.js +28 -28
  49. package/lib/plan-cache.d.ts +16 -16
  50. package/lib/plan-cache.js +70 -70
  51. package/lib/replica-set.d.ts +45 -45
  52. package/lib/replica-set.js +314 -314
  53. package/lib/result.d.ts +61 -61
  54. package/lib/result.js +104 -104
  55. package/lib/session.d.ts +25 -25
  56. package/lib/session.js +88 -88
  57. package/lib/shard.d.ts +42 -42
  58. package/lib/shard.js +414 -414
  59. package/lib/shell-api.d.ts +52 -52
  60. package/lib/shell-api.js +298 -298
  61. package/lib/shell-bson.d.ts +40 -40
  62. package/lib/shell-bson.js +159 -159
  63. package/lib/shell-instance-state.d.ts +77 -77
  64. package/lib/shell-instance-state.js +392 -392
  65. package/package.json +47 -47
  66. package/tsconfig.lint.json +8 -8
@@ -1,112 +1,112 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- Object.defineProperty(exports, "__esModule", { value: true });
9
- const decorators_1 = require("./decorators");
10
- const result_1 = require("./result");
11
- const enums_1 = require("./enums");
12
- const errors_1 = require("@qp-mongosh/errors");
13
- const helpers_1 = require("./helpers");
14
- let ChangeStreamCursor = class ChangeStreamCursor extends decorators_1.ShellApiWithMongoClass {
15
- constructor(cursor, on, mongo) {
16
- super();
17
- this._currentIterationResult = null;
18
- this._cursor = cursor;
19
- this._on = on;
20
- this._mongo = mongo;
21
- }
22
- async _it() {
23
- if (this._cursor.closed) {
24
- throw new errors_1.MongoshRuntimeError('ChangeStreamCursor is closed');
25
- }
26
- const result = this._currentIterationResult = new result_1.CursorIterationResult();
27
- return (0, helpers_1.iterate)(result, this, await this._mongo._displayBatchSize());
28
- }
29
- [enums_1.asPrintable]() {
30
- return `ChangeStreamCursor on ${this._on}`;
31
- }
32
- async close() {
33
- await this._cursor.close();
34
- }
35
- async hasNext() {
36
- await this._instanceState.printWarning('If there are no documents in the batch, hasNext will block. Use tryNext if you want to check if there ' +
37
- 'are any documents without waiting.');
38
- return this._cursor.hasNext();
39
- }
40
- async tryNext() {
41
- if (this._cursor.closed) {
42
- throw new errors_1.MongoshRuntimeError('Cannot call tryNext on closed cursor');
43
- }
44
- return this._cursor.tryNext();
45
- }
46
- async *[Symbol.asyncIterator]() {
47
- let doc;
48
- while ((doc = await this.tryNext()) !== null) {
49
- yield doc;
50
- }
51
- }
52
- isClosed() {
53
- return this._cursor.closed;
54
- }
55
- isExhausted() {
56
- throw new errors_1.MongoshInvalidInputError('isExhausted is not implemented for ChangeStreams because after closing a cursor, the remaining documents in the batch are no longer accessible. If you want to see if the cursor is closed use isClosed. If you want to see if there are documents left in the batch, use tryNext.');
57
- }
58
- async itcount() {
59
- let count = 0;
60
- while (await this.tryNext()) {
61
- count++;
62
- }
63
- return count;
64
- }
65
- async next() {
66
- await this._instanceState.printWarning('If there are no documents in the batch, next will block. Use tryNext if you want to check if there are ' +
67
- 'any documents without waiting.');
68
- return this._cursor.next();
69
- }
70
- getResumeToken() {
71
- return this._cursor.resumeToken;
72
- }
73
- map() {
74
- throw new errors_1.MongoshUnimplementedError('Cannot call map on a change stream cursor');
75
- }
76
- forEach() {
77
- throw new errors_1.MongoshUnimplementedError('Cannot call forEach on a change stream cursor');
78
- }
79
- toArray() {
80
- throw new errors_1.MongoshUnimplementedError('Cannot call toArray on a change stream cursor');
81
- }
82
- objsLeftInBatch() {
83
- throw new errors_1.MongoshUnimplementedError('Cannot call objsLeftInBatch on a change stream cursor');
84
- }
85
- pretty() {
86
- return this;
87
- }
88
- };
89
- __decorate([
90
- decorators_1.returnsPromise
91
- ], ChangeStreamCursor.prototype, "close", null);
92
- __decorate([
93
- decorators_1.returnsPromise,
94
- decorators_1.deprecated
95
- ], ChangeStreamCursor.prototype, "hasNext", null);
96
- __decorate([
97
- decorators_1.returnsPromise
98
- ], ChangeStreamCursor.prototype, "tryNext", null);
99
- __decorate([
100
- decorators_1.returnsPromise
101
- ], ChangeStreamCursor.prototype, "itcount", null);
102
- __decorate([
103
- decorators_1.returnsPromise
104
- ], ChangeStreamCursor.prototype, "next", null);
105
- __decorate([
106
- (0, decorators_1.returnType)('ChangeStreamCursor')
107
- ], ChangeStreamCursor.prototype, "pretty", null);
108
- ChangeStreamCursor = __decorate([
109
- decorators_1.shellApiClassDefault
110
- ], ChangeStreamCursor);
111
- exports.default = ChangeStreamCursor;
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ Object.defineProperty(exports, "__esModule", { value: true });
9
+ const decorators_1 = require("./decorators");
10
+ const result_1 = require("./result");
11
+ const enums_1 = require("./enums");
12
+ const errors_1 = require("@qp-mongosh/errors");
13
+ const helpers_1 = require("./helpers");
14
+ let ChangeStreamCursor = class ChangeStreamCursor extends decorators_1.ShellApiWithMongoClass {
15
+ constructor(cursor, on, mongo) {
16
+ super();
17
+ this._currentIterationResult = null;
18
+ this._cursor = cursor;
19
+ this._on = on;
20
+ this._mongo = mongo;
21
+ }
22
+ async _it() {
23
+ if (this._cursor.closed) {
24
+ throw new errors_1.MongoshRuntimeError('ChangeStreamCursor is closed');
25
+ }
26
+ const result = this._currentIterationResult = new result_1.CursorIterationResult();
27
+ return (0, helpers_1.iterate)(result, this, await this._mongo._displayBatchSize());
28
+ }
29
+ [enums_1.asPrintable]() {
30
+ return `ChangeStreamCursor on ${this._on}`;
31
+ }
32
+ async close() {
33
+ await this._cursor.close();
34
+ }
35
+ async hasNext() {
36
+ await this._instanceState.printWarning('If there are no documents in the batch, hasNext will block. Use tryNext if you want to check if there ' +
37
+ 'are any documents without waiting.');
38
+ return this._cursor.hasNext();
39
+ }
40
+ async tryNext() {
41
+ if (this._cursor.closed) {
42
+ throw new errors_1.MongoshRuntimeError('Cannot call tryNext on closed cursor');
43
+ }
44
+ return this._cursor.tryNext();
45
+ }
46
+ async *[Symbol.asyncIterator]() {
47
+ let doc;
48
+ while ((doc = await this.tryNext()) !== null) {
49
+ yield doc;
50
+ }
51
+ }
52
+ isClosed() {
53
+ return this._cursor.closed;
54
+ }
55
+ isExhausted() {
56
+ throw new errors_1.MongoshInvalidInputError('isExhausted is not implemented for ChangeStreams because after closing a cursor, the remaining documents in the batch are no longer accessible. If you want to see if the cursor is closed use isClosed. If you want to see if there are documents left in the batch, use tryNext.');
57
+ }
58
+ async itcount() {
59
+ let count = 0;
60
+ while (await this.tryNext()) {
61
+ count++;
62
+ }
63
+ return count;
64
+ }
65
+ async next() {
66
+ await this._instanceState.printWarning('If there are no documents in the batch, next will block. Use tryNext if you want to check if there are ' +
67
+ 'any documents without waiting.');
68
+ return this._cursor.next();
69
+ }
70
+ getResumeToken() {
71
+ return this._cursor.resumeToken;
72
+ }
73
+ map() {
74
+ throw new errors_1.MongoshUnimplementedError('Cannot call map on a change stream cursor');
75
+ }
76
+ forEach() {
77
+ throw new errors_1.MongoshUnimplementedError('Cannot call forEach on a change stream cursor');
78
+ }
79
+ toArray() {
80
+ throw new errors_1.MongoshUnimplementedError('Cannot call toArray on a change stream cursor');
81
+ }
82
+ objsLeftInBatch() {
83
+ throw new errors_1.MongoshUnimplementedError('Cannot call objsLeftInBatch on a change stream cursor');
84
+ }
85
+ pretty() {
86
+ return this;
87
+ }
88
+ };
89
+ __decorate([
90
+ decorators_1.returnsPromise
91
+ ], ChangeStreamCursor.prototype, "close", null);
92
+ __decorate([
93
+ decorators_1.returnsPromise,
94
+ decorators_1.deprecated
95
+ ], ChangeStreamCursor.prototype, "hasNext", null);
96
+ __decorate([
97
+ decorators_1.returnsPromise
98
+ ], ChangeStreamCursor.prototype, "tryNext", null);
99
+ __decorate([
100
+ decorators_1.returnsPromise
101
+ ], ChangeStreamCursor.prototype, "itcount", null);
102
+ __decorate([
103
+ decorators_1.returnsPromise
104
+ ], ChangeStreamCursor.prototype, "next", null);
105
+ __decorate([
106
+ (0, decorators_1.returnType)('ChangeStreamCursor')
107
+ ], ChangeStreamCursor.prototype, "pretty", null);
108
+ ChangeStreamCursor = __decorate([
109
+ decorators_1.shellApiClassDefault
110
+ ], ChangeStreamCursor);
111
+ exports.default = ChangeStreamCursor;
112
112
  //# sourceMappingURL=change-stream-cursor.js.map
@@ -1,95 +1,95 @@
1
- import Mongo from './mongo';
2
- import { Namespace, ShellApiWithMongoClass } from './decorators';
3
- import { asPrintable, namespaceInfo } from './enums';
4
- import { FindAndModifyShellOptions, FindAndModifyMethodShellOptions, RemoveShellOptions, MapReduceShellOptions } from './helpers';
5
- import { AnyBulkWriteOperation, BulkWriteOptions, CollStatsOptions, CountOptions, CountDocumentsOptions, ChangeStreamOptions, CreateIndexesOptions, DeleteOptions, DistinctOptions, Document, EstimatedDocumentCountOptions, ExplainVerbosityLike, FindOneAndDeleteOptions, FindOneAndReplaceOptions, FindOneAndUpdateOptions, FindOptions, InsertOneOptions, ReplaceOptions, RunCommandOptions, UpdateOptions } from '@qp-mongosh/service-provider-core';
6
- import { AggregationCursor, BulkWriteResult, CommandResult, Cursor, Database, DeleteResult, Explainable, InsertManyResult, InsertOneResult, UpdateResult } from './index';
7
- import Bulk from './bulk';
8
- import PlanCache from './plan-cache';
9
- import ChangeStreamCursor from './change-stream-cursor';
10
- declare type CollStatsShellOptions = CollStatsOptions & {
11
- indexDetails?: boolean;
12
- indexDetailsKey?: Document;
13
- indexDetailsName?: string;
14
- };
15
- export default class Collection extends ShellApiWithMongoClass {
16
- _mongo: Mongo;
17
- _database: Database;
18
- _name: string;
19
- constructor(mongo: Mongo, database: Database, name: string);
20
- [namespaceInfo](): Namespace;
21
- [asPrintable](): string;
22
- private _emitCollectionApiCall;
23
- aggregate(pipeline: Document[], options: Document & {
24
- explain?: never;
25
- }): Promise<AggregationCursor>;
26
- aggregate(pipeline: Document[], options: Document & {
27
- explain: ExplainVerbosityLike;
28
- }): Promise<Document>;
29
- aggregate(...stages: Document[]): Promise<AggregationCursor>;
30
- bulkWrite(operations: AnyBulkWriteOperation[], options?: BulkWriteOptions): Promise<BulkWriteResult>;
31
- count(query?: {}, options?: CountOptions): Promise<number>;
32
- countDocuments(query?: Document, options?: CountDocumentsOptions): Promise<number>;
33
- deleteMany(filter: Document, options?: DeleteOptions): Promise<DeleteResult | Document>;
34
- deleteOne(filter: Document, options?: DeleteOptions): Promise<DeleteResult | Document>;
35
- distinct(field: string): Promise<Document>;
36
- distinct(field: string, query: Document): Promise<Document>;
37
- distinct(field: string, query: Document, options: DistinctOptions): Promise<Document>;
38
- estimatedDocumentCount(options?: EstimatedDocumentCountOptions): Promise<number>;
39
- find(query?: Document, projection?: Document, options?: FindOptions): Promise<Cursor>;
40
- findAndModify(options: FindAndModifyMethodShellOptions): Promise<Document>;
41
- findOne(query?: Document, projection?: Document, options?: FindOptions): Promise<Document | null>;
42
- renameCollection(newName: string, dropTarget?: boolean): Promise<Document>;
43
- findOneAndDelete(filter: Document, options?: FindOneAndDeleteOptions): Promise<Document>;
44
- findOneAndReplace(filter: Document, replacement: Document, options?: FindAndModifyShellOptions<FindOneAndReplaceOptions>): Promise<Document>;
45
- findOneAndUpdate(filter: Document, update: Document | Document[], options?: FindAndModifyShellOptions<FindOneAndUpdateOptions>): Promise<Document>;
46
- insert(docs: Document | Document[], options?: BulkWriteOptions): Promise<InsertManyResult>;
47
- insertMany(docs: Document[], options?: BulkWriteOptions): Promise<InsertManyResult>;
48
- insertOne(doc: Document, options?: InsertOneOptions): Promise<InsertOneResult>;
49
- isCapped(): Promise<boolean>;
50
- remove(query: Document, options?: boolean | RemoveShellOptions): Promise<DeleteResult | Document>;
51
- save(): never;
52
- replaceOne(filter: Document, replacement: Document, options?: ReplaceOptions): Promise<UpdateResult>;
53
- update(filter: Document, update: Document, options?: UpdateOptions & {
54
- multi?: boolean;
55
- }): Promise<UpdateResult | Document>;
56
- updateMany(filter: Document, update: Document, options?: UpdateOptions): Promise<UpdateResult | Document>;
57
- updateOne(filter: Document, update: Document, options?: UpdateOptions): Promise<UpdateResult | Document>;
58
- convertToCapped(size: number): Promise<Document>;
59
- _createIndexes(keyPatterns: Document[], options?: CreateIndexesOptions, commitQuorum?: number | string): Promise<string[]>;
60
- createIndexes(keyPatterns: Document[], options?: CreateIndexesOptions, commitQuorum?: number | string): Promise<string[]>;
61
- createIndex(keys: Document, options?: CreateIndexesOptions, commitQuorum?: number | string): Promise<string>;
62
- ensureIndex(keys: Document, options?: CreateIndexesOptions, commitQuorum?: number | string): Promise<Document>;
63
- getIndexes(): Promise<Document[]>;
64
- getIndexSpecs(): Promise<Document[]>;
65
- getIndices(): Promise<Document[]>;
66
- getIndexKeys(): Promise<Document[]>;
67
- dropIndexes(indexes?: string | string[] | Document | Document[]): Promise<Document>;
68
- dropIndex(index: string | Document): Promise<Document>;
69
- totalIndexSize(...args: any[]): Promise<number>;
70
- reIndex(): Promise<Document>;
71
- getDB(): Database;
72
- getMongo(): Mongo;
73
- dataSize(): Promise<number>;
74
- storageSize(): Promise<number>;
75
- totalSize(): Promise<number>;
76
- drop(): Promise<boolean>;
77
- exists(): Promise<Document>;
78
- getFullName(): string;
79
- getName(): string;
80
- runCommand(commandName: string | Document, options?: RunCommandOptions): Promise<Document>;
81
- explain(verbosity?: ExplainVerbosityLike): Explainable;
82
- stats(originalOptions?: CollStatsShellOptions | number): Promise<Document>;
83
- latencyStats(options?: Document): Promise<Document[]>;
84
- initializeOrderedBulkOp(): Promise<Bulk>;
85
- initializeUnorderedBulkOp(): Promise<Bulk>;
86
- getPlanCache(): PlanCache;
87
- mapReduce(map: Function | string, reduce: Function | string, optionsOrOutString: MapReduceShellOptions): Promise<Document>;
88
- validate(options?: boolean | Document): Promise<Document>;
89
- getShardVersion(): Promise<Document>;
90
- getShardDistribution(): Promise<CommandResult>;
91
- watch(pipeline?: Document[] | ChangeStreamOptions, options?: ChangeStreamOptions): Promise<ChangeStreamCursor>;
92
- hideIndex(index: string | Document): Promise<Document>;
93
- unhideIndex(index: string | Document): Promise<Document>;
94
- }
95
- export {};
1
+ import Mongo from './mongo';
2
+ import { Namespace, ShellApiWithMongoClass } from './decorators';
3
+ import { asPrintable, namespaceInfo } from './enums';
4
+ import { FindAndModifyShellOptions, FindAndModifyMethodShellOptions, RemoveShellOptions, MapReduceShellOptions } from './helpers';
5
+ import { AnyBulkWriteOperation, BulkWriteOptions, CollStatsOptions, CountOptions, CountDocumentsOptions, ChangeStreamOptions, CreateIndexesOptions, DeleteOptions, DistinctOptions, Document, EstimatedDocumentCountOptions, ExplainVerbosityLike, FindOneAndDeleteOptions, FindOneAndReplaceOptions, FindOneAndUpdateOptions, FindOptions, InsertOneOptions, ReplaceOptions, RunCommandOptions, UpdateOptions } from '@qp-mongosh/service-provider-core';
6
+ import { AggregationCursor, BulkWriteResult, CommandResult, Cursor, Database, DeleteResult, Explainable, InsertManyResult, InsertOneResult, UpdateResult } from './index';
7
+ import Bulk from './bulk';
8
+ import PlanCache from './plan-cache';
9
+ import ChangeStreamCursor from './change-stream-cursor';
10
+ declare type CollStatsShellOptions = CollStatsOptions & {
11
+ indexDetails?: boolean;
12
+ indexDetailsKey?: Document;
13
+ indexDetailsName?: string;
14
+ };
15
+ export default class Collection extends ShellApiWithMongoClass {
16
+ _mongo: Mongo;
17
+ _database: Database;
18
+ _name: string;
19
+ constructor(mongo: Mongo, database: Database, name: string);
20
+ [namespaceInfo](): Namespace;
21
+ [asPrintable](): string;
22
+ private _emitCollectionApiCall;
23
+ aggregate(pipeline: Document[], options: Document & {
24
+ explain?: never;
25
+ }): Promise<AggregationCursor>;
26
+ aggregate(pipeline: Document[], options: Document & {
27
+ explain: ExplainVerbosityLike;
28
+ }): Promise<Document>;
29
+ aggregate(...stages: Document[]): Promise<AggregationCursor>;
30
+ bulkWrite(operations: AnyBulkWriteOperation[], options?: BulkWriteOptions): Promise<BulkWriteResult>;
31
+ count(query?: {}, options?: CountOptions): Promise<number>;
32
+ countDocuments(query?: Document, options?: CountDocumentsOptions): Promise<number>;
33
+ deleteMany(filter: Document, options?: DeleteOptions): Promise<DeleteResult | Document>;
34
+ deleteOne(filter: Document, options?: DeleteOptions): Promise<DeleteResult | Document>;
35
+ distinct(field: string): Promise<Document>;
36
+ distinct(field: string, query: Document): Promise<Document>;
37
+ distinct(field: string, query: Document, options: DistinctOptions): Promise<Document>;
38
+ estimatedDocumentCount(options?: EstimatedDocumentCountOptions): Promise<number>;
39
+ find(query?: Document, projection?: Document, options?: FindOptions): Promise<Cursor>;
40
+ findAndModify(options: FindAndModifyMethodShellOptions): Promise<Document>;
41
+ findOne(query?: Document, projection?: Document, options?: FindOptions): Promise<Document | null>;
42
+ renameCollection(newName: string, dropTarget?: boolean): Promise<Document>;
43
+ findOneAndDelete(filter: Document, options?: FindOneAndDeleteOptions): Promise<Document>;
44
+ findOneAndReplace(filter: Document, replacement: Document, options?: FindAndModifyShellOptions<FindOneAndReplaceOptions>): Promise<Document>;
45
+ findOneAndUpdate(filter: Document, update: Document | Document[], options?: FindAndModifyShellOptions<FindOneAndUpdateOptions>): Promise<Document>;
46
+ insert(docs: Document | Document[], options?: BulkWriteOptions): Promise<InsertManyResult>;
47
+ insertMany(docs: Document[], options?: BulkWriteOptions): Promise<InsertManyResult>;
48
+ insertOne(doc: Document, options?: InsertOneOptions): Promise<InsertOneResult>;
49
+ isCapped(): Promise<boolean>;
50
+ remove(query: Document, options?: boolean | RemoveShellOptions): Promise<DeleteResult | Document>;
51
+ save(): never;
52
+ replaceOne(filter: Document, replacement: Document, options?: ReplaceOptions): Promise<UpdateResult>;
53
+ update(filter: Document, update: Document, options?: UpdateOptions & {
54
+ multi?: boolean;
55
+ }): Promise<UpdateResult | Document>;
56
+ updateMany(filter: Document, update: Document, options?: UpdateOptions): Promise<UpdateResult | Document>;
57
+ updateOne(filter: Document, update: Document, options?: UpdateOptions): Promise<UpdateResult | Document>;
58
+ convertToCapped(size: number): Promise<Document>;
59
+ _createIndexes(keyPatterns: Document[], options?: CreateIndexesOptions, commitQuorum?: number | string): Promise<string[]>;
60
+ createIndexes(keyPatterns: Document[], options?: CreateIndexesOptions, commitQuorum?: number | string): Promise<string[]>;
61
+ createIndex(keys: Document, options?: CreateIndexesOptions, commitQuorum?: number | string): Promise<string>;
62
+ ensureIndex(keys: Document, options?: CreateIndexesOptions, commitQuorum?: number | string): Promise<Document>;
63
+ getIndexes(): Promise<Document[]>;
64
+ getIndexSpecs(): Promise<Document[]>;
65
+ getIndices(): Promise<Document[]>;
66
+ getIndexKeys(): Promise<Document[]>;
67
+ dropIndexes(indexes?: string | string[] | Document | Document[]): Promise<Document>;
68
+ dropIndex(index: string | Document): Promise<Document>;
69
+ totalIndexSize(...args: any[]): Promise<number>;
70
+ reIndex(): Promise<Document>;
71
+ getDB(): Database;
72
+ getMongo(): Mongo;
73
+ dataSize(): Promise<number>;
74
+ storageSize(): Promise<number>;
75
+ totalSize(): Promise<number>;
76
+ drop(): Promise<boolean>;
77
+ exists(): Promise<Document>;
78
+ getFullName(): string;
79
+ getName(): string;
80
+ runCommand(commandName: string | Document, options?: RunCommandOptions): Promise<Document>;
81
+ explain(verbosity?: ExplainVerbosityLike): Explainable;
82
+ stats(originalOptions?: CollStatsShellOptions | number): Promise<Document>;
83
+ latencyStats(options?: Document): Promise<Document[]>;
84
+ initializeOrderedBulkOp(): Promise<Bulk>;
85
+ initializeUnorderedBulkOp(): Promise<Bulk>;
86
+ getPlanCache(): PlanCache;
87
+ mapReduce(map: Function | string, reduce: Function | string, optionsOrOutString: MapReduceShellOptions): Promise<Document>;
88
+ validate(options?: boolean | Document): Promise<Document>;
89
+ getShardVersion(): Promise<Document>;
90
+ getShardDistribution(): Promise<CommandResult>;
91
+ watch(pipeline?: Document[] | ChangeStreamOptions, options?: ChangeStreamOptions): Promise<ChangeStreamCursor>;
92
+ hideIndex(index: string | Document): Promise<Document>;
93
+ unhideIndex(index: string | Document): Promise<Document>;
94
+ }
95
+ export {};