I have the following code, which should try to find a document in a collection. If that item does not exist, the flow should continue without failing or aborting the transaction. When no matching item is found in the collection, the code below currently emits
Command failed with error 251 (NoSuchTransaction): 'Transaction 3 has been aborted.' and I haven’t been able to find a way to continue the transaction instead of aborting it.
return Single.fromPublisher(collection.find(session, Filters.eq("item", item))) .map(Optional::of) .onErrorReturnItem(Optional.empty()) .observeOn(RxHelper.scheduler(context));
How do I use the reactive driver to search for an item that does not exist, without failing?