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