Skip to content

feat(NODE-4733): deprecate result and getLastOp #3458

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Nov 7, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 12 additions & 2 deletions src/bulk/common.ts
Original file line number Diff line number Diff line change
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