Skip to content
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

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

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.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
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;
dariakp marked this conversation as resolved.
Show resolved Hide resolved

/**
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