Skip to content

Commit 8693987

Browse files
authored
feat(NODE-5186)!: remove duplicate BulkWriteResult accessors (#3766)
1 parent ee56c8e commit 8693987

File tree

4 files changed

+17
-63
lines changed

4 files changed

+17
-63
lines changed

src/bulk/common.ts

Lines changed: 13 additions & 59 deletions
Original file line numberDiff line numberDiff line change
@@ -212,62 +212,6 @@ export class BulkWriteResult {
212212
return this.result.ok;
213213
}
214214

215-
/**
216-
* The number of inserted documents
217-
* @deprecated Use insertedCount instead.
218-
*/
219-
get nInserted(): number {
220-
return this.result.nInserted;
221-
}
222-
223-
/**
224-
* Number of upserted documents
225-
* @deprecated User upsertedCount instead.
226-
*/
227-
get nUpserted(): number {
228-
return this.result.nUpserted;
229-
}
230-
231-
/**
232-
* Number of matched documents
233-
* @deprecated Use matchedCount instead.
234-
*/
235-
get nMatched(): number {
236-
return this.result.nMatched;
237-
}
238-
239-
/**
240-
* Number of documents updated physically on disk
241-
* @deprecated Use modifiedCount instead.
242-
*/
243-
get nModified(): number {
244-
return this.result.nModified;
245-
}
246-
247-
/**
248-
* Number of removed documents
249-
* @deprecated Use deletedCount instead.
250-
*/
251-
get nRemoved(): number {
252-
return this.result.nRemoved;
253-
}
254-
255-
/**
256-
* Returns an array of all inserted ids
257-
* @deprecated Use insertedIds instead.
258-
*/
259-
getInsertedIds(): Document[] {
260-
return this.result.insertedIds;
261-
}
262-
263-
/**
264-
* Returns an array of all upserted ids
265-
* @deprecated Use upsertedIds instead.
266-
*/
267-
getUpsertedIds(): Document[] {
268-
return this.result.upserted;
269-
}
270-
271215
/** Returns the upserted id at the given index */
272216
getUpsertedIdAt(index: number): Document | undefined {
273217
return this.result.upserted[index];
@@ -864,11 +808,21 @@ export interface BulkOperationPrivate {
864808

865809
/** @public */
866810
export interface BulkWriteOptions extends CommandOperationOptions {
867-
/** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */
811+
/**
812+
* Allow driver to bypass schema validation.
813+
* @defaultValue `false` - documents will be validated by default
814+
**/
868815
bypassDocumentValidation?: boolean;
869-
/** If true, when an insert fails, don't execute the remaining writes. If false, continue with remaining inserts when one fails. */
816+
/**
817+
* If true, when an insert fails, don't execute the remaining writes.
818+
* If false, continue with remaining inserts when one fails.
819+
* @defaultValue `true` - inserts are ordered by default
820+
*/
870821
ordered?: boolean;
871-
/** Force server to assign _id values instead of driver. */
822+
/**
823+
* Force server to assign _id values instead of driver.
824+
* @defaultValue `false` - the driver generates `_id` fields by default
825+
**/
872826
forceServerObjectId?: boolean;
873827
/** Map of parameter names and values that can be accessed using $$var (requires MongoDB 5.0). */
874828
let?: Document;

src/operations/aggregate.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export interface AggregateOptions extends CommandOperationOptions {
2121
allowDiskUse?: boolean;
2222
/** The number of documents to return per batch. See [aggregation documentation](https://www.mongodb.com/docs/manual/reference/command/aggregate). */
2323
batchSize?: number;
24-
/** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */
24+
/** Allow driver to bypass schema validation. */
2525
bypassDocumentValidation?: boolean;
2626
/** Return the query as cursor, on 2.6 \> it returns as a real cursor on pre 2.6 it returns as an emulated cursor. */
2727
cursor?: Document;

src/operations/find_and_modify.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ export interface FindOneAndDeleteOptions extends CommandOperationOptions {
3838

3939
/** @public */
4040
export interface FindOneAndReplaceOptions extends CommandOperationOptions {
41-
/** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */
41+
/** Allow driver to bypass schema validation. */
4242
bypassDocumentValidation?: boolean;
4343
/** An optional hint for query optimization. See the {@link https://www.mongodb.com/docs/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/
4444
hint?: Document;
@@ -63,7 +63,7 @@ export interface FindOneAndReplaceOptions extends CommandOperationOptions {
6363
export interface FindOneAndUpdateOptions extends CommandOperationOptions {
6464
/** Optional list of array filters referenced in filtered positional operators */
6565
arrayFilters?: Document[];
66-
/** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */
66+
/** Allow driver to bypass schema validation. */
6767
bypassDocumentValidation?: boolean;
6868
/** An optional hint for query optimization. See the {@link https://www.mongodb.com/docs/manual/reference/command/update/#update-command-hint|update command} reference for more information.*/
6969
hint?: Document;

src/operations/insert.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@ export class InsertOperation extends CommandCallbackOperation<Document> {
5353

5454
/** @public */
5555
export interface InsertOneOptions extends CommandOperationOptions {
56-
/** Allow driver to bypass schema validation in MongoDB 3.2 or higher. */
56+
/** Allow driver to bypass schema validation. */
5757
bypassDocumentValidation?: boolean;
5858
/** Force server to assign _id values instead of driver. */
5959
forceServerObjectId?: boolean;

0 commit comments

Comments
 (0)