Package com.couchbase.client.java.batch
Class ReactiveBatchHelper
java.lang.Object
com.couchbase.client.java.batch.ReactiveBatchHelper
This helper class provides methods that make performing batch operations easy and comfortable.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionexists
(Collection collection, Collection<String> ids) Returns a flux of ids for the documents that exist.getIfExists
(Collection collection, Collection<String> ids) First checks if the given IDs exist and if so fetches their contents.
-
Constructor Details
-
ReactiveBatchHelper
public ReactiveBatchHelper()
-
-
Method Details
-
getIfExists
@Uncommitted public static Mono<Map<String,GetResult>> getIfExists(Collection collection, Collection<String> ids) First checks if the given IDs exist and if so fetches their contents.Please take into consideration when using this API that it only makes sense to use it if of the many ids provided only a small subset comes back. (So let's say you give it 1000 IDs but you only expect 50 to be there or so). Otherwise if all are most of them are there, just use a bulk get with the reactive API directly - you won't see much benefit in this case.
- Parameters:
collection
- the collection to perform the fetch on.ids
- the document IDs to fetch.- Returns:
- a Map of the document IDs as the key and the result (if found).
-
exists
Returns a flux of ids for the documents that exist.Note that you usually only want to use this API if you really need to bulk check exists on many documents at once, for all other use cases we recommend trying the regular, supported APIs first (i.e. using
ReactiveCollection.exists(String)
).- Parameters:
collection
- the collection to perform the exists checks on.ids
- the document IDs to check.- Returns:
- a flux of all the ids that are found.
-