Skip to content

Commit

Permalink
Add missing methods to ReactiveMongoCollection
Browse files Browse the repository at this point in the history
  • Loading branch information
loicmathieu committed Jan 10, 2024
1 parent 53f95bb commit aa33f8f
Show file tree
Hide file tree
Showing 2 changed files with 74 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -667,6 +667,27 @@ public Uni<T> findOneAndUpdate(ClientSession clientSession, Bson filter, Bson up
return Wrappers.toUni(collection.findOneAndUpdate(clientSession, filter, update, options));
}

@Override
public Uni<T> findOneAndUpdate(Bson filter, List<? extends Bson> update) {
return Wrappers.toUni(collection.findOneAndUpdate(filter, update));
}

@Override
public Uni<T> findOneAndUpdate(Bson filter, List<? extends Bson> update, FindOneAndUpdateOptions options) {
return Wrappers.toUni(collection.findOneAndUpdate(filter, update, options));
}

@Override
public Uni<T> findOneAndUpdate(ClientSession clientSession, Bson filter, List<? extends Bson> update) {
return Wrappers.toUni(collection.findOneAndUpdate(clientSession, filter, update));
}

@Override
public Uni<T> findOneAndUpdate(ClientSession clientSession, Bson filter, List<? extends Bson> update,
FindOneAndUpdateOptions options) {
return Wrappers.toUni(collection.findOneAndUpdate(clientSession, filter, update, options));
}

@Override
public Uni<Void> drop() {
return Wrappers.toUni(collection.drop());
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1217,6 +1217,59 @@ Uni<T> findOneAndReplace(ClientSession clientSession, Bson filter, T replacement
Uni<T> findOneAndUpdate(ClientSession clientSession, Bson filter, Bson update,
FindOneAndUpdateOptions options);

/**
* Atomically find a document and update it.
*
* <p>Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.</p>
* @param filter a document describing the query filter, which may not be null.
* @param update a pipeline describing the update, which may not be null.
* @return a publisher with a single element the document that was updated. Depending on the value of the {@code returnOriginal}
* property, this will either be the document as it was before the update or as it is after the update. If no documents matched the
* query filter, then null will be returned
*/
Uni<T> findOneAndUpdate(Bson filter, List<? extends Bson> update);

/**
* Atomically find a document and update it.
*
* <p>Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.</p>
* @param filter a document describing the query filter, which may not be null.
* @param update a pipeline describing the update, which may not be null.
* @param options the options to apply to the operation
* @return a publisher with a single element the document that was updated. Depending on the value of the {@code returnOriginal}
* property, this will either be the document as it was before the update or as it is after the update. If no documents matched the
* query filter, then null will be returned
*/
Uni<T> findOneAndUpdate(Bson filter, List<? extends Bson> update, FindOneAndUpdateOptions options);

/**
* Atomically find a document and update it.
*
* <p>Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.</p>
* @param clientSession the client session with which to associate this operation
* @param filter a document describing the query filter, which may not be null.
* @param update a pipeline describing the update, which may not be null.
* @return a publisher with a single element the document that was updated. Depending on the value of the {@code returnOriginal}
* property, this will either be the document as it was before the update or as it is after the update. If no documents matched the
* query filter, then null will be returned
*/
Uni<T> findOneAndUpdate(ClientSession clientSession, Bson filter, List<? extends Bson> update);

/**
* Atomically find a document and update it.
*
* <p>Note: Supports retryable writes on MongoDB server versions 3.6 or higher when the retryWrites setting is enabled.</p>
* @param clientSession the client session with which to associate this operation
* @param filter a document describing the query filter, which may not be null.
* @param update a pipeline describing the update, which may not be null.
* @param options the options to apply to the operation
* @return a publisher with a single element the document that was updated. Depending on the value of the {@code returnOriginal}
* property, this will either be the document as it was before the update or as it is after the update. If no documents matched the
* query filter, then null will be returned
*/
Uni<T> findOneAndUpdate(ClientSession clientSession, Bson filter, List<? extends Bson> update,
FindOneAndUpdateOptions options);

/**
* Drops this collection from the database.
*
Expand Down

0 comments on commit aa33f8f

Please sign in to comment.