Skip to content

Commit

Permalink
fix: update result
Browse files Browse the repository at this point in the history
  • Loading branch information
nbbeeken committed Aug 19, 2021
1 parent cee16f7 commit f911afd
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions src/collection.ts
Original file line number Diff line number Diff line change
Expand Up @@ -414,34 +414,39 @@ export class Collection<TSchema extends Document = Document> {
updateOne(
filter: Filter<TSchema>,
update: UpdateFilter<TSchema> | Partial<TSchema>
): Promise<UpdateResult | Document>;
): Promise<UpdateResult>;
updateOne(
filter: Filter<TSchema>,
update: UpdateFilter<TSchema> | Partial<TSchema>,
callback: Callback<UpdateResult | Document>
callback: Callback<UpdateResult>
): void;
updateOne(
filter: Filter<TSchema>,
update: UpdateFilter<TSchema> | Partial<TSchema>,
options: UpdateOptions
): Promise<UpdateResult | Document>;
): Promise<UpdateResult>;
updateOne(
filter: Filter<TSchema>,
update: UpdateFilter<TSchema> | Partial<TSchema>,
options: UpdateOptions,
callback: Callback<UpdateResult | Document>
callback: Callback<UpdateResult>
): void;
updateOne(
filter: Filter<TSchema>,
update: UpdateFilter<TSchema> | Partial<TSchema>,
options?: UpdateOptions | Callback<UpdateResult | Document>,
callback?: Callback<UpdateResult | Document>
): Promise<UpdateResult | Document> | void {
options?: UpdateOptions | Callback<UpdateResult>,
callback?: Callback<UpdateResult>
): Promise<UpdateResult> | void {
if (typeof options === 'function') (callback = options), (options = {});

return executeOperation(
getTopology(this),
new UpdateOneOperation(this as TODO_NODE_3286, filter, update, resolveOptions(this, options)),
new UpdateOneOperation(
this as TODO_NODE_3286,
filter,
update,
resolveOptions(this, options)
) as TODO_NODE_3286,
callback
);
}
Expand Down

0 comments on commit f911afd

Please sign in to comment.