Skip to content

Commit

Permalink
feat(NODE-4733): deprecate result and getLastOp (#3458)
Browse files Browse the repository at this point in the history
  • Loading branch information
durran committed Nov 7, 2022
1 parent bf7a132 commit a143d3b
Showing 1 changed file with 12 additions and 2 deletions.
14 changes: 12 additions & 2 deletions src/bulk/common.ts
Expand Up @@ -130,7 +130,11 @@ export type AnyBulkWriteOperation<TSchema extends Document = Document> =
| { deleteOne: DeleteOneModel<TSchema> }
| { deleteMany: DeleteManyModel<TSchema> };

/** @public */
/**
* @public
*
* @deprecated Will be made internal in 5.0
*/
export interface BulkResult {
ok: number;
writeErrors: WriteError[];
Expand Down Expand Up @@ -176,6 +180,7 @@ export class Batch<T = Document> {
* The result of a bulk write.
*/
export class BulkWriteResult {
/** @deprecated Will be removed in 5.0 */
result: BulkResult;

/**
Expand Down Expand Up @@ -295,7 +300,11 @@ export class BulkWriteResult {
return this.result.writeErrors;
}

/** Retrieve lastOp if available */
/**
* Retrieve lastOp if available
*
* @deprecated Will be removed in 5.0
*/
getLastOp(): Document | undefined {
return this.result.opTime;
}
Expand All @@ -322,6 +331,7 @@ export class BulkWriteResult {
}
}

/* @deprecated Will be removed in 5.0 release */
toJSON(): BulkResult {
return this.result;
}
Expand Down

0 comments on commit a143d3b

Please sign in to comment.