@qp-mongosh/shell-api 0.0.0-dev.0 → 0.0.0-dev.3
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/.eslintignore +2 -2
- package/.eslintrc.js +1 -1
- package/AUTHORS +15 -15
- package/LICENSE +200 -200
- package/bin/report-missing-help.ts +24 -24
- package/bin/report-supported-api.ts +14 -14
- package/lib/abstract-cursor.d.ts +33 -33
- package/lib/abstract-cursor.js +191 -191
- package/lib/aggregation-cursor.d.ts +6 -6
- package/lib/aggregation-cursor.js +19 -19
- package/lib/bulk.d.ts +43 -43
- package/lib/bulk.js +223 -223
- package/lib/change-stream-cursor.d.ts +28 -28
- package/lib/change-stream-cursor.js +111 -111
- package/lib/collection.d.ts +95 -95
- package/lib/collection.js +964 -964
- package/lib/cursor.d.ts +32 -32
- package/lib/cursor.js +215 -215
- package/lib/database.d.ts +116 -116
- package/lib/database.js +1223 -1223
- package/lib/dbquery.d.ts +8 -8
- package/lib/dbquery.js +28 -28
- package/lib/decorators.d.ts +73 -73
- package/lib/decorators.js +395 -395
- package/lib/enums.d.ts +28 -28
- package/lib/enums.js +33 -33
- package/lib/error-codes.d.ts +12 -12
- package/lib/error-codes.js +19 -19
- package/lib/explainable-cursor.d.ts +11 -11
- package/lib/explainable-cursor.js +31 -31
- package/lib/explainable.d.ts +32 -32
- package/lib/explainable.js +166 -166
- package/lib/field-level-encryption.d.ts +50 -50
- package/lib/field-level-encryption.js +176 -176
- package/lib/help.d.ts +22 -22
- package/lib/help.js +26 -26
- package/lib/helpers.d.ts +71 -71
- package/lib/helpers.js +588 -588
- package/lib/index.d.ts +16 -16
- package/lib/index.js +45 -45
- package/lib/interruptor.d.ts +19 -19
- package/lib/interruptor.js +62 -62
- package/lib/mongo-errors.d.ts +5 -5
- package/lib/mongo-errors.js +37 -37
- package/lib/mongo.d.ts +75 -75
- package/lib/mongo.js +476 -476
- package/lib/no-db.d.ts +5 -5
- package/lib/no-db.js +28 -28
- package/lib/plan-cache.d.ts +16 -16
- package/lib/plan-cache.js +70 -70
- package/lib/replica-set.d.ts +45 -45
- package/lib/replica-set.js +314 -314
- package/lib/result.d.ts +61 -61
- package/lib/result.js +104 -104
- package/lib/session.d.ts +25 -25
- package/lib/session.js +88 -88
- package/lib/shard.d.ts +42 -42
- package/lib/shard.js +414 -414
- package/lib/shell-api.d.ts +52 -52
- package/lib/shell-api.js +298 -298
- package/lib/shell-bson.d.ts +40 -40
- package/lib/shell-bson.js +159 -159
- package/lib/shell-instance-state.d.ts +77 -77
- package/lib/shell-instance-state.js +392 -392
- package/package.json +47 -47
- package/tsconfig.lint.json +8 -8
package/lib/abstract-cursor.js
CHANGED
|
@@ -1,192 +1,192 @@
|
|
|
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
|
-
exports.AbstractCursor = void 0;
|
|
10
|
-
const decorators_1 = require("./decorators");
|
|
11
|
-
const enums_1 = require("./enums");
|
|
12
|
-
const result_1 = require("./result");
|
|
13
|
-
const helpers_1 = require("./helpers");
|
|
14
|
-
let AbstractCursor = class AbstractCursor extends decorators_1.ShellApiWithMongoClass {
|
|
15
|
-
constructor(mongo, cursor) {
|
|
16
|
-
super();
|
|
17
|
-
this._currentIterationResult = null;
|
|
18
|
-
this._mongo = mongo;
|
|
19
|
-
this._cursor = cursor;
|
|
20
|
-
this._transform = null;
|
|
21
|
-
}
|
|
22
|
-
async [enums_1.asPrintable]() {
|
|
23
|
-
var _a;
|
|
24
|
-
return (await (0, decorators_1.toShellResult)((_a = this._currentIterationResult) !== null && _a !== void 0 ? _a : await this._it())).printable;
|
|
25
|
-
}
|
|
26
|
-
async _it() {
|
|
27
|
-
const results = this._currentIterationResult = new result_1.CursorIterationResult();
|
|
28
|
-
await (0, helpers_1.iterate)(results, this, await this._mongo._displayBatchSize());
|
|
29
|
-
results.cursorHasMore = !this.isExhausted();
|
|
30
|
-
return results;
|
|
31
|
-
}
|
|
32
|
-
batchSize(size) {
|
|
33
|
-
this._cursor.batchSize(size);
|
|
34
|
-
return this;
|
|
35
|
-
}
|
|
36
|
-
async close(options) {
|
|
37
|
-
await this._cursor.close(options);
|
|
38
|
-
}
|
|
39
|
-
async forEach(f) {
|
|
40
|
-
for await (const doc of this) {
|
|
41
|
-
if ((await f(doc)) === false) {
|
|
42
|
-
break;
|
|
43
|
-
}
|
|
44
|
-
}
|
|
45
|
-
}
|
|
46
|
-
async hasNext() {
|
|
47
|
-
return this._cursor.hasNext();
|
|
48
|
-
}
|
|
49
|
-
async tryNext() {
|
|
50
|
-
let result = await this._cursor.tryNext();
|
|
51
|
-
if (result !== null && this._transform !== null) {
|
|
52
|
-
result = await this._transform(result);
|
|
53
|
-
}
|
|
54
|
-
return result;
|
|
55
|
-
}
|
|
56
|
-
async *[Symbol.asyncIterator]() {
|
|
57
|
-
let doc;
|
|
58
|
-
while ((doc = await this.tryNext()) !== null) {
|
|
59
|
-
yield doc;
|
|
60
|
-
}
|
|
61
|
-
}
|
|
62
|
-
isClosed() {
|
|
63
|
-
return this._cursor.closed;
|
|
64
|
-
}
|
|
65
|
-
isExhausted() {
|
|
66
|
-
return this.isClosed() && this.objsLeftInBatch() === 0;
|
|
67
|
-
}
|
|
68
|
-
async itcount() {
|
|
69
|
-
let count = 0;
|
|
70
|
-
while (await this.tryNext()) {
|
|
71
|
-
count++;
|
|
72
|
-
}
|
|
73
|
-
return count;
|
|
74
|
-
}
|
|
75
|
-
async toArray() {
|
|
76
|
-
const result = [];
|
|
77
|
-
for await (const doc of this) {
|
|
78
|
-
result.push(doc);
|
|
79
|
-
}
|
|
80
|
-
return result;
|
|
81
|
-
}
|
|
82
|
-
pretty() {
|
|
83
|
-
return this;
|
|
84
|
-
}
|
|
85
|
-
map(f) {
|
|
86
|
-
if (this._transform === null) {
|
|
87
|
-
this._transform = f;
|
|
88
|
-
}
|
|
89
|
-
else {
|
|
90
|
-
const g = this._transform;
|
|
91
|
-
this._transform = (doc) => f(g(doc));
|
|
92
|
-
}
|
|
93
|
-
return this;
|
|
94
|
-
}
|
|
95
|
-
maxTimeMS(value) {
|
|
96
|
-
this._cursor.maxTimeMS(value);
|
|
97
|
-
return this;
|
|
98
|
-
}
|
|
99
|
-
async next() {
|
|
100
|
-
let result = await this._cursor.next();
|
|
101
|
-
if (result !== null && this._transform !== null) {
|
|
102
|
-
result = await this._transform(result);
|
|
103
|
-
}
|
|
104
|
-
return result;
|
|
105
|
-
}
|
|
106
|
-
projection(spec) {
|
|
107
|
-
this._cursor.project(spec);
|
|
108
|
-
return this;
|
|
109
|
-
}
|
|
110
|
-
skip(value) {
|
|
111
|
-
this._cursor.skip(value);
|
|
112
|
-
return this;
|
|
113
|
-
}
|
|
114
|
-
sort(spec) {
|
|
115
|
-
this._cursor.sort(spec);
|
|
116
|
-
return this;
|
|
117
|
-
}
|
|
118
|
-
objsLeftInBatch() {
|
|
119
|
-
return this._cursor.bufferedCount();
|
|
120
|
-
}
|
|
121
|
-
async explain(verbosity) {
|
|
122
|
-
if (verbosity !== undefined) {
|
|
123
|
-
verbosity = (0, helpers_1.validateExplainableVerbosity)(verbosity);
|
|
124
|
-
}
|
|
125
|
-
const fullExplain = await this._cursor.explain(verbosity);
|
|
126
|
-
const explain = {
|
|
127
|
-
...fullExplain
|
|
128
|
-
};
|
|
129
|
-
if (verbosity !== 'executionStats' &&
|
|
130
|
-
verbosity !== 'allPlansExecution' &&
|
|
131
|
-
explain.executionStats) {
|
|
132
|
-
delete explain.executionStats;
|
|
133
|
-
}
|
|
134
|
-
if (verbosity === 'executionStats' &&
|
|
135
|
-
explain.executionStats &&
|
|
136
|
-
explain.executionStats.allPlansExecution) {
|
|
137
|
-
delete explain.executionStats.allPlansExecution;
|
|
138
|
-
}
|
|
139
|
-
return (0, helpers_1.markAsExplainOutput)(explain);
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
__decorate([
|
|
143
|
-
(0, decorators_1.returnType)('this')
|
|
144
|
-
], AbstractCursor.prototype, "batchSize", null);
|
|
145
|
-
__decorate([
|
|
146
|
-
decorators_1.returnsPromise
|
|
147
|
-
], AbstractCursor.prototype, "close", null);
|
|
148
|
-
__decorate([
|
|
149
|
-
decorators_1.returnsPromise
|
|
150
|
-
], AbstractCursor.prototype, "forEach", null);
|
|
151
|
-
__decorate([
|
|
152
|
-
decorators_1.returnsPromise
|
|
153
|
-
], AbstractCursor.prototype, "hasNext", null);
|
|
154
|
-
__decorate([
|
|
155
|
-
decorators_1.returnsPromise
|
|
156
|
-
], AbstractCursor.prototype, "tryNext", null);
|
|
157
|
-
__decorate([
|
|
158
|
-
decorators_1.returnsPromise
|
|
159
|
-
], AbstractCursor.prototype, "itcount", null);
|
|
160
|
-
__decorate([
|
|
161
|
-
decorators_1.returnsPromise
|
|
162
|
-
], AbstractCursor.prototype, "toArray", null);
|
|
163
|
-
__decorate([
|
|
164
|
-
(0, decorators_1.returnType)('this')
|
|
165
|
-
], AbstractCursor.prototype, "pretty", null);
|
|
166
|
-
__decorate([
|
|
167
|
-
(0, decorators_1.returnType)('this')
|
|
168
|
-
], AbstractCursor.prototype, "map", null);
|
|
169
|
-
__decorate([
|
|
170
|
-
(0, decorators_1.returnType)('this')
|
|
171
|
-
], AbstractCursor.prototype, "maxTimeMS", null);
|
|
172
|
-
__decorate([
|
|
173
|
-
decorators_1.returnsPromise
|
|
174
|
-
], AbstractCursor.prototype, "next", null);
|
|
175
|
-
__decorate([
|
|
176
|
-
(0, decorators_1.returnType)('this')
|
|
177
|
-
], AbstractCursor.prototype, "projection", null);
|
|
178
|
-
__decorate([
|
|
179
|
-
(0, decorators_1.returnType)('this')
|
|
180
|
-
], AbstractCursor.prototype, "skip", null);
|
|
181
|
-
__decorate([
|
|
182
|
-
(0, decorators_1.returnType)('this')
|
|
183
|
-
], AbstractCursor.prototype, "sort", null);
|
|
184
|
-
__decorate([
|
|
185
|
-
decorators_1.returnsPromise,
|
|
186
|
-
(0, decorators_1.apiVersions)([1])
|
|
187
|
-
], AbstractCursor.prototype, "explain", null);
|
|
188
|
-
AbstractCursor = __decorate([
|
|
189
|
-
decorators_1.shellApiClassNoHelp
|
|
190
|
-
], AbstractCursor);
|
|
191
|
-
exports.AbstractCursor = AbstractCursor;
|
|
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
|
+
exports.AbstractCursor = void 0;
|
|
10
|
+
const decorators_1 = require("./decorators");
|
|
11
|
+
const enums_1 = require("./enums");
|
|
12
|
+
const result_1 = require("./result");
|
|
13
|
+
const helpers_1 = require("./helpers");
|
|
14
|
+
let AbstractCursor = class AbstractCursor extends decorators_1.ShellApiWithMongoClass {
|
|
15
|
+
constructor(mongo, cursor) {
|
|
16
|
+
super();
|
|
17
|
+
this._currentIterationResult = null;
|
|
18
|
+
this._mongo = mongo;
|
|
19
|
+
this._cursor = cursor;
|
|
20
|
+
this._transform = null;
|
|
21
|
+
}
|
|
22
|
+
async [enums_1.asPrintable]() {
|
|
23
|
+
var _a;
|
|
24
|
+
return (await (0, decorators_1.toShellResult)((_a = this._currentIterationResult) !== null && _a !== void 0 ? _a : await this._it())).printable;
|
|
25
|
+
}
|
|
26
|
+
async _it() {
|
|
27
|
+
const results = this._currentIterationResult = new result_1.CursorIterationResult();
|
|
28
|
+
await (0, helpers_1.iterate)(results, this, await this._mongo._displayBatchSize());
|
|
29
|
+
results.cursorHasMore = !this.isExhausted();
|
|
30
|
+
return results;
|
|
31
|
+
}
|
|
32
|
+
batchSize(size) {
|
|
33
|
+
this._cursor.batchSize(size);
|
|
34
|
+
return this;
|
|
35
|
+
}
|
|
36
|
+
async close(options) {
|
|
37
|
+
await this._cursor.close(options);
|
|
38
|
+
}
|
|
39
|
+
async forEach(f) {
|
|
40
|
+
for await (const doc of this) {
|
|
41
|
+
if ((await f(doc)) === false) {
|
|
42
|
+
break;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
async hasNext() {
|
|
47
|
+
return this._cursor.hasNext();
|
|
48
|
+
}
|
|
49
|
+
async tryNext() {
|
|
50
|
+
let result = await this._cursor.tryNext();
|
|
51
|
+
if (result !== null && this._transform !== null) {
|
|
52
|
+
result = await this._transform(result);
|
|
53
|
+
}
|
|
54
|
+
return result;
|
|
55
|
+
}
|
|
56
|
+
async *[Symbol.asyncIterator]() {
|
|
57
|
+
let doc;
|
|
58
|
+
while ((doc = await this.tryNext()) !== null) {
|
|
59
|
+
yield doc;
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
isClosed() {
|
|
63
|
+
return this._cursor.closed;
|
|
64
|
+
}
|
|
65
|
+
isExhausted() {
|
|
66
|
+
return this.isClosed() && this.objsLeftInBatch() === 0;
|
|
67
|
+
}
|
|
68
|
+
async itcount() {
|
|
69
|
+
let count = 0;
|
|
70
|
+
while (await this.tryNext()) {
|
|
71
|
+
count++;
|
|
72
|
+
}
|
|
73
|
+
return count;
|
|
74
|
+
}
|
|
75
|
+
async toArray() {
|
|
76
|
+
const result = [];
|
|
77
|
+
for await (const doc of this) {
|
|
78
|
+
result.push(doc);
|
|
79
|
+
}
|
|
80
|
+
return result;
|
|
81
|
+
}
|
|
82
|
+
pretty() {
|
|
83
|
+
return this;
|
|
84
|
+
}
|
|
85
|
+
map(f) {
|
|
86
|
+
if (this._transform === null) {
|
|
87
|
+
this._transform = f;
|
|
88
|
+
}
|
|
89
|
+
else {
|
|
90
|
+
const g = this._transform;
|
|
91
|
+
this._transform = (doc) => f(g(doc));
|
|
92
|
+
}
|
|
93
|
+
return this;
|
|
94
|
+
}
|
|
95
|
+
maxTimeMS(value) {
|
|
96
|
+
this._cursor.maxTimeMS(value);
|
|
97
|
+
return this;
|
|
98
|
+
}
|
|
99
|
+
async next() {
|
|
100
|
+
let result = await this._cursor.next();
|
|
101
|
+
if (result !== null && this._transform !== null) {
|
|
102
|
+
result = await this._transform(result);
|
|
103
|
+
}
|
|
104
|
+
return result;
|
|
105
|
+
}
|
|
106
|
+
projection(spec) {
|
|
107
|
+
this._cursor.project(spec);
|
|
108
|
+
return this;
|
|
109
|
+
}
|
|
110
|
+
skip(value) {
|
|
111
|
+
this._cursor.skip(value);
|
|
112
|
+
return this;
|
|
113
|
+
}
|
|
114
|
+
sort(spec) {
|
|
115
|
+
this._cursor.sort(spec);
|
|
116
|
+
return this;
|
|
117
|
+
}
|
|
118
|
+
objsLeftInBatch() {
|
|
119
|
+
return this._cursor.bufferedCount();
|
|
120
|
+
}
|
|
121
|
+
async explain(verbosity) {
|
|
122
|
+
if (verbosity !== undefined) {
|
|
123
|
+
verbosity = (0, helpers_1.validateExplainableVerbosity)(verbosity);
|
|
124
|
+
}
|
|
125
|
+
const fullExplain = await this._cursor.explain(verbosity);
|
|
126
|
+
const explain = {
|
|
127
|
+
...fullExplain
|
|
128
|
+
};
|
|
129
|
+
if (verbosity !== 'executionStats' &&
|
|
130
|
+
verbosity !== 'allPlansExecution' &&
|
|
131
|
+
explain.executionStats) {
|
|
132
|
+
delete explain.executionStats;
|
|
133
|
+
}
|
|
134
|
+
if (verbosity === 'executionStats' &&
|
|
135
|
+
explain.executionStats &&
|
|
136
|
+
explain.executionStats.allPlansExecution) {
|
|
137
|
+
delete explain.executionStats.allPlansExecution;
|
|
138
|
+
}
|
|
139
|
+
return (0, helpers_1.markAsExplainOutput)(explain);
|
|
140
|
+
}
|
|
141
|
+
};
|
|
142
|
+
__decorate([
|
|
143
|
+
(0, decorators_1.returnType)('this')
|
|
144
|
+
], AbstractCursor.prototype, "batchSize", null);
|
|
145
|
+
__decorate([
|
|
146
|
+
decorators_1.returnsPromise
|
|
147
|
+
], AbstractCursor.prototype, "close", null);
|
|
148
|
+
__decorate([
|
|
149
|
+
decorators_1.returnsPromise
|
|
150
|
+
], AbstractCursor.prototype, "forEach", null);
|
|
151
|
+
__decorate([
|
|
152
|
+
decorators_1.returnsPromise
|
|
153
|
+
], AbstractCursor.prototype, "hasNext", null);
|
|
154
|
+
__decorate([
|
|
155
|
+
decorators_1.returnsPromise
|
|
156
|
+
], AbstractCursor.prototype, "tryNext", null);
|
|
157
|
+
__decorate([
|
|
158
|
+
decorators_1.returnsPromise
|
|
159
|
+
], AbstractCursor.prototype, "itcount", null);
|
|
160
|
+
__decorate([
|
|
161
|
+
decorators_1.returnsPromise
|
|
162
|
+
], AbstractCursor.prototype, "toArray", null);
|
|
163
|
+
__decorate([
|
|
164
|
+
(0, decorators_1.returnType)('this')
|
|
165
|
+
], AbstractCursor.prototype, "pretty", null);
|
|
166
|
+
__decorate([
|
|
167
|
+
(0, decorators_1.returnType)('this')
|
|
168
|
+
], AbstractCursor.prototype, "map", null);
|
|
169
|
+
__decorate([
|
|
170
|
+
(0, decorators_1.returnType)('this')
|
|
171
|
+
], AbstractCursor.prototype, "maxTimeMS", null);
|
|
172
|
+
__decorate([
|
|
173
|
+
decorators_1.returnsPromise
|
|
174
|
+
], AbstractCursor.prototype, "next", null);
|
|
175
|
+
__decorate([
|
|
176
|
+
(0, decorators_1.returnType)('this')
|
|
177
|
+
], AbstractCursor.prototype, "projection", null);
|
|
178
|
+
__decorate([
|
|
179
|
+
(0, decorators_1.returnType)('this')
|
|
180
|
+
], AbstractCursor.prototype, "skip", null);
|
|
181
|
+
__decorate([
|
|
182
|
+
(0, decorators_1.returnType)('this')
|
|
183
|
+
], AbstractCursor.prototype, "sort", null);
|
|
184
|
+
__decorate([
|
|
185
|
+
decorators_1.returnsPromise,
|
|
186
|
+
(0, decorators_1.apiVersions)([1])
|
|
187
|
+
], AbstractCursor.prototype, "explain", null);
|
|
188
|
+
AbstractCursor = __decorate([
|
|
189
|
+
decorators_1.shellApiClassNoHelp
|
|
190
|
+
], AbstractCursor);
|
|
191
|
+
exports.AbstractCursor = AbstractCursor;
|
|
192
192
|
//# sourceMappingURL=abstract-cursor.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import type Mongo from './mongo';
|
|
2
|
-
import type { AggregationCursor as ServiceProviderAggregationCursor } from '@qp-mongosh/service-provider-core';
|
|
3
|
-
import { AbstractCursor } from './abstract-cursor';
|
|
4
|
-
export default class AggregationCursor extends AbstractCursor<ServiceProviderAggregationCursor> {
|
|
5
|
-
constructor(mongo: Mongo, cursor: ServiceProviderAggregationCursor);
|
|
6
|
-
}
|
|
1
|
+
import type Mongo from './mongo';
|
|
2
|
+
import type { AggregationCursor as ServiceProviderAggregationCursor } from '@qp-mongosh/service-provider-core';
|
|
3
|
+
import { AbstractCursor } from './abstract-cursor';
|
|
4
|
+
export default class AggregationCursor extends AbstractCursor<ServiceProviderAggregationCursor> {
|
|
5
|
+
constructor(mongo: Mongo, cursor: ServiceProviderAggregationCursor);
|
|
6
|
+
}
|
|
@@ -1,20 +1,20 @@
|
|
|
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 abstract_cursor_1 = require("./abstract-cursor");
|
|
11
|
-
let AggregationCursor = class AggregationCursor extends abstract_cursor_1.AbstractCursor {
|
|
12
|
-
constructor(mongo, cursor) {
|
|
13
|
-
super(mongo, cursor);
|
|
14
|
-
}
|
|
15
|
-
};
|
|
16
|
-
AggregationCursor = __decorate([
|
|
17
|
-
decorators_1.shellApiClassDefault
|
|
18
|
-
], AggregationCursor);
|
|
19
|
-
exports.default = AggregationCursor;
|
|
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 abstract_cursor_1 = require("./abstract-cursor");
|
|
11
|
+
let AggregationCursor = class AggregationCursor extends abstract_cursor_1.AbstractCursor {
|
|
12
|
+
constructor(mongo, cursor) {
|
|
13
|
+
super(mongo, cursor);
|
|
14
|
+
}
|
|
15
|
+
};
|
|
16
|
+
AggregationCursor = __decorate([
|
|
17
|
+
decorators_1.shellApiClassDefault
|
|
18
|
+
], AggregationCursor);
|
|
19
|
+
exports.default = AggregationCursor;
|
|
20
20
|
//# sourceMappingURL=aggregation-cursor.js.map
|
package/lib/bulk.d.ts
CHANGED
|
@@ -1,43 +1,43 @@
|
|
|
1
|
-
import { ShellApiWithMongoClass } from './decorators';
|
|
2
|
-
import Mongo from './mongo';
|
|
3
|
-
import { Batch, Document, WriteConcern, OrderedBulkOperation, UnorderedBulkOperation, FindOperators, CollationOptions } from '@qp-mongosh/service-provider-core';
|
|
4
|
-
import { asPrintable } from './enums';
|
|
5
|
-
import { BulkWriteResult } from './result';
|
|
6
|
-
import type Collection from './collection';
|
|
7
|
-
export declare class BulkFindOp extends ShellApiWithMongoClass {
|
|
8
|
-
_serviceProviderBulkFindOp: FindOperators;
|
|
9
|
-
_parentBulk: Bulk;
|
|
10
|
-
_hint: Document | undefined;
|
|
11
|
-
_arrayFilters: Document[] | undefined;
|
|
12
|
-
constructor(innerFind: FindOperators, parentBulk: Bulk);
|
|
13
|
-
get _mongo(): Mongo;
|
|
14
|
-
[asPrintable](): string;
|
|
15
|
-
collation(spec: CollationOptions): BulkFindOp;
|
|
16
|
-
arrayFilters(filters: Document[]): BulkFindOp;
|
|
17
|
-
hint(hintDoc: Document): BulkFindOp;
|
|
18
|
-
delete(): Bulk;
|
|
19
|
-
deleteOne(): Bulk;
|
|
20
|
-
remove(): Bulk;
|
|
21
|
-
removeOne(): Bulk;
|
|
22
|
-
replaceOne(replacement: Document): Bulk;
|
|
23
|
-
updateOne(update: Document): Bulk;
|
|
24
|
-
update(update: Document): Bulk;
|
|
25
|
-
upsert(): BulkFindOp;
|
|
26
|
-
}
|
|
27
|
-
export default class Bulk extends ShellApiWithMongoClass {
|
|
28
|
-
_mongo: Mongo;
|
|
29
|
-
_collection: Collection;
|
|
30
|
-
_batchCounts: any;
|
|
31
|
-
_executed: boolean;
|
|
32
|
-
_serviceProviderBulkOp: OrderedBulkOperation | UnorderedBulkOperation;
|
|
33
|
-
_ordered: boolean;
|
|
34
|
-
constructor(collection: Collection, innerBulk: OrderedBulkOperation | UnorderedBulkOperation, ordered?: boolean);
|
|
35
|
-
[asPrintable](): any;
|
|
36
|
-
private _emitBulkApiCall;
|
|
37
|
-
execute(writeConcern?: WriteConcern): Promise<BulkWriteResult>;
|
|
38
|
-
find(query: Document): BulkFindOp;
|
|
39
|
-
insert(document: Document): Bulk;
|
|
40
|
-
toJSON(): Record<'nInsertOps' | 'nUpdateOps' | 'nRemoveOps' | 'nBatches', number>;
|
|
41
|
-
toString(): string;
|
|
42
|
-
getOperations(): Pick<Batch, 'originalZeroIndex' | 'batchType' | 'operations'>[];
|
|
43
|
-
}
|
|
1
|
+
import { ShellApiWithMongoClass } from './decorators';
|
|
2
|
+
import Mongo from './mongo';
|
|
3
|
+
import { Batch, Document, WriteConcern, OrderedBulkOperation, UnorderedBulkOperation, FindOperators, CollationOptions } from '@qp-mongosh/service-provider-core';
|
|
4
|
+
import { asPrintable } from './enums';
|
|
5
|
+
import { BulkWriteResult } from './result';
|
|
6
|
+
import type Collection from './collection';
|
|
7
|
+
export declare class BulkFindOp extends ShellApiWithMongoClass {
|
|
8
|
+
_serviceProviderBulkFindOp: FindOperators;
|
|
9
|
+
_parentBulk: Bulk;
|
|
10
|
+
_hint: Document | undefined;
|
|
11
|
+
_arrayFilters: Document[] | undefined;
|
|
12
|
+
constructor(innerFind: FindOperators, parentBulk: Bulk);
|
|
13
|
+
get _mongo(): Mongo;
|
|
14
|
+
[asPrintable](): string;
|
|
15
|
+
collation(spec: CollationOptions): BulkFindOp;
|
|
16
|
+
arrayFilters(filters: Document[]): BulkFindOp;
|
|
17
|
+
hint(hintDoc: Document): BulkFindOp;
|
|
18
|
+
delete(): Bulk;
|
|
19
|
+
deleteOne(): Bulk;
|
|
20
|
+
remove(): Bulk;
|
|
21
|
+
removeOne(): Bulk;
|
|
22
|
+
replaceOne(replacement: Document): Bulk;
|
|
23
|
+
updateOne(update: Document): Bulk;
|
|
24
|
+
update(update: Document): Bulk;
|
|
25
|
+
upsert(): BulkFindOp;
|
|
26
|
+
}
|
|
27
|
+
export default class Bulk extends ShellApiWithMongoClass {
|
|
28
|
+
_mongo: Mongo;
|
|
29
|
+
_collection: Collection;
|
|
30
|
+
_batchCounts: any;
|
|
31
|
+
_executed: boolean;
|
|
32
|
+
_serviceProviderBulkOp: OrderedBulkOperation | UnorderedBulkOperation;
|
|
33
|
+
_ordered: boolean;
|
|
34
|
+
constructor(collection: Collection, innerBulk: OrderedBulkOperation | UnorderedBulkOperation, ordered?: boolean);
|
|
35
|
+
[asPrintable](): any;
|
|
36
|
+
private _emitBulkApiCall;
|
|
37
|
+
execute(writeConcern?: WriteConcern): Promise<BulkWriteResult>;
|
|
38
|
+
find(query: Document): BulkFindOp;
|
|
39
|
+
insert(document: Document): Bulk;
|
|
40
|
+
toJSON(): Record<'nInsertOps' | 'nUpdateOps' | 'nRemoveOps' | 'nBatches', number>;
|
|
41
|
+
toString(): string;
|
|
42
|
+
getOperations(): Pick<Batch, 'originalZeroIndex' | 'batchType' | 'operations'>[];
|
|
43
|
+
}
|