Skip to content

Commit b62ffaf

Browse files
strogiyotecAlmas Abdrazak
andauthored
Update reactive streams MongoCollection docs (#1840)
Update the java doc for MongoCollection Instead of returning null we return an empty Publisher The naming for returning empty publisher were borrowed from https://docs.oracle.com/en/java/javase/17/docs/api/java.net.http/java/net/http/HttpRequest.BodyPublishers.html ``` If the sequence is empty an empty publisher is returned. Otherwise, if the sequence contains a single element, that publisher is returned. Otherwise a concatenation publisher is returned. ``` Co-authored-by: Almas Abdrazak <abdrazak.almas@mongodb.com>
1 parent b6c1f33 commit b62ffaf

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

driver-reactive-streams/src/main/com/mongodb/reactivestreams/client/MongoCollection.java

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -1212,8 +1212,8 @@ Publisher<BulkWriteResult> bulkWrite(ClientSession clientSession, List<? extends
12121212
* Atomically find a document and remove it.
12131213
*
12141214
* @param filter the query filter to find the document with
1215-
* @return a publisher with a single element the document that was removed. If no documents matched the query filter, then null will be
1216-
* returned
1215+
* @return a publisher with a single element the document that was removed. If no documents matched the query filter, then an empty
1216+
* publisher is returned
12171217
*/
12181218
Publisher<TDocument> findOneAndDelete(Bson filter);
12191219

@@ -1222,8 +1222,8 @@ Publisher<BulkWriteResult> bulkWrite(ClientSession clientSession, List<? extends
12221222
*
12231223
* @param filter the query filter to find the document with
12241224
* @param options the options to apply to the operation
1225-
* @return a publisher with a single element the document that was removed. If no documents matched the query filter, then null will be
1226-
* returned
1225+
* @return a publisher with a single element the document that was removed. If no documents matched the query filter,
1226+
* then an empty publisher is returned
12271227
*/
12281228
Publisher<TDocument> findOneAndDelete(Bson filter, FindOneAndDeleteOptions options);
12291229

@@ -1232,8 +1232,8 @@ Publisher<BulkWriteResult> bulkWrite(ClientSession clientSession, List<? extends
12321232
*
12331233
* @param clientSession the client session with which to associate this operation
12341234
* @param filter the query filter to find the document with
1235-
* @return a publisher with a single element the document that was removed. If no documents matched the query filter, then null will be
1236-
* returned
1235+
* @return a publisher with a single element the document that was removed. If no documents matched the query filter,
1236+
* then an empty publisher is returned
12371237
* @mongodb.server.release 3.6
12381238
* @since 1.7
12391239
*/
@@ -1245,8 +1245,8 @@ Publisher<BulkWriteResult> bulkWrite(ClientSession clientSession, List<? extends
12451245
* @param clientSession the client session with which to associate this operation
12461246
* @param filter the query filter to find the document with
12471247
* @param options the options to apply to the operation
1248-
* @return a publisher with a single element the document that was removed. If no documents matched the query filter, then null will be
1249-
* returned
1248+
* @return a publisher with a single element the document that was removed. If no documents matched the query filter,
1249+
* then an empty publisher is returned
12501250
* @mongodb.server.release 3.6
12511251
* @since 1.7
12521252
*/
@@ -1259,7 +1259,7 @@ Publisher<BulkWriteResult> bulkWrite(ClientSession clientSession, List<? extends
12591259
* @param replacement the replacement document
12601260
* @return a publisher with a single element the document that was replaced. Depending on the value of the {@code returnOriginal}
12611261
* 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
1262-
* query filter, then null will be returned
1262+
* query filter, then an empty publisher is returned
12631263
*/
12641264
Publisher<TDocument> findOneAndReplace(Bson filter, TDocument replacement);
12651265

@@ -1271,7 +1271,7 @@ Publisher<BulkWriteResult> bulkWrite(ClientSession clientSession, List<? extends
12711271
* @param options the options to apply to the operation
12721272
* @return a publisher with a single element the document that was replaced. Depending on the value of the {@code returnOriginal}
12731273
* 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
1274-
* query filter, then null will be returned
1274+
* query filter, then an empty publisher is returned
12751275
*/
12761276
Publisher<TDocument> findOneAndReplace(Bson filter, TDocument replacement, FindOneAndReplaceOptions options);
12771277

@@ -1283,7 +1283,7 @@ Publisher<BulkWriteResult> bulkWrite(ClientSession clientSession, List<? extends
12831283
* @param replacement the replacement document
12841284
* @return a publisher with a single element the document that was replaced. Depending on the value of the {@code returnOriginal}
12851285
* 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
1286-
* query filter, then null will be returned
1286+
* query filter, then an empty publisher is returned
12871287
* @mongodb.server.release 3.6
12881288
* @since 1.7
12891289
*/
@@ -1298,7 +1298,7 @@ Publisher<BulkWriteResult> bulkWrite(ClientSession clientSession, List<? extends
12981298
* @param options the options to apply to the operation
12991299
* @return a publisher with a single element the document that was replaced. Depending on the value of the {@code returnOriginal}
13001300
* 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
1301-
* query filter, then null will be returned
1301+
* query filter, then an empty publisher is returned
13021302
* @mongodb.server.release 3.6
13031303
* @since 1.7
13041304
*/
@@ -1311,7 +1311,7 @@ Publisher<TDocument> findOneAndReplace(ClientSession clientSession, Bson filter,
13111311
* @param filter a document describing the query filter, which may not be null.
13121312
* @param update a document describing the update, which may not be null. The update to apply must include only update operators.
13131313
* @return a publisher with a single element the document that was updated before the update was applied. If no documents matched the
1314-
* query filter, then null will be returned
1314+
* query filter, then an empty publisher is returned
13151315
*/
13161316
Publisher<TDocument> findOneAndUpdate(Bson filter, Bson update);
13171317

@@ -1323,7 +1323,7 @@ Publisher<TDocument> findOneAndReplace(ClientSession clientSession, Bson filter,
13231323
* @param options the options to apply to the operation
13241324
* @return a publisher with a single element the document that was updated. Depending on the value of the {@code returnOriginal}
13251325
* 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
1326-
* query filter, then null will be returned
1326+
* query filter, then an empty publisher is returned
13271327
*/
13281328
Publisher<TDocument> findOneAndUpdate(Bson filter, Bson update, FindOneAndUpdateOptions options);
13291329

@@ -1334,7 +1334,7 @@ Publisher<TDocument> findOneAndReplace(ClientSession clientSession, Bson filter,
13341334
* @param filter a document describing the query filter, which may not be null.
13351335
* @param update a document describing the update, which may not be null. The update to apply must include only update operators.
13361336
* @return a publisher with a single element the document that was updated before the update was applied. If no documents matched the
1337-
* query filter, then null will be returned
1337+
* query filter, then an empty publisher is returned
13381338
* @mongodb.server.release 3.6
13391339
* @since 1.7
13401340
*/
@@ -1349,7 +1349,7 @@ Publisher<TDocument> findOneAndReplace(ClientSession clientSession, Bson filter,
13491349
* @param options the options to apply to the operation
13501350
* @return a publisher with a single element the document that was updated. Depending on the value of the {@code returnOriginal}
13511351
* 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
1352-
* query filter, then null will be returned
1352+
* query filter, then an empty publisher is returned
13531353
* @mongodb.server.release 3.6
13541354
* @since 1.7
13551355
*/
@@ -1363,7 +1363,7 @@ Publisher<TDocument> findOneAndReplace(ClientSession clientSession, Bson filter,
13631363
* @param update a pipeline describing the update, which may not be null.
13641364
* @return a publisher with a single element the document that was updated. Depending on the value of the {@code returnOriginal}
13651365
* 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
1366-
* query filter, then null will be returned
1366+
* query filter, then an empty publisher is returned
13671367
* @since 1.12
13681368
* @mongodb.server.release 4.2
13691369
*/
@@ -1378,7 +1378,7 @@ Publisher<TDocument> findOneAndReplace(ClientSession clientSession, Bson filter,
13781378
* @param options the options to apply to the operation
13791379
* @return a publisher with a single element the document that was updated. Depending on the value of the {@code returnOriginal}
13801380
* 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
1381-
* query filter, then null will be returned
1381+
* query filter, then an empty publisher is returned
13821382
* @since 1.12
13831383
* @mongodb.server.release 4.2
13841384
*/
@@ -1393,7 +1393,7 @@ Publisher<TDocument> findOneAndReplace(ClientSession clientSession, Bson filter,
13931393
* @param update a pipeline describing the update, which may not be null.
13941394
* @return a publisher with a single element the document that was updated. Depending on the value of the {@code returnOriginal}
13951395
* 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
1396-
* query filter, then null will be returned
1396+
* query filter, then an empty publisher is returned
13971397
* @since 1.12
13981398
* @mongodb.server.release 4.2
13991399
*/
@@ -1409,7 +1409,7 @@ Publisher<TDocument> findOneAndReplace(ClientSession clientSession, Bson filter,
14091409
* @param options the options to apply to the operation
14101410
* @return a publisher with a single element the document that was updated. Depending on the value of the {@code returnOriginal}
14111411
* 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
1412-
* query filter, then null will be returned
1412+
* query filter, then an empty publisher is returned
14131413
* @since 1.12
14141414
* @mongodb.server.release 4.2
14151415
*/

0 commit comments

Comments
 (0)