This library implements database operations using Reactive Programming for MongoDB
Questions tagged [spring-data-mongodb-reactive]
62 questions
0
votes
2 answers
Update 1 or multiple specific field MongoDB using Spring boot WebFlux,Spring Data MongoDB Reactive and ReactiveMongoRepository
I'm newbie with java. I tried to implement update method for my API. I want to update some field of my data.
Here is my data class:
public class Task implements Serializable {
@Id
private String id;
private String task;
private…

MadTik
- 102
- 3
- 9
0
votes
0 answers
Or operator criteria in Spring Data MongoDB
I updated my Spring Data Mongodb reactive example to the latest Spring Boot(2.5.6), there is a findByKeyword method to use regex to match Post title and content.
Flux findByKeyword(String q) {
var reg = ".*" + q + ".*";
return…

Hantsy
- 8,006
- 7
- 64
- 109
0
votes
1 answer
Spring Data MongoDB outputType for aggregate not mapping with custom ReactiveMongoTemplate
I'm trying to map the results from an aggregate operation to a DTO.
It's not mapping correctly and there is no error or log message to indicate what / where it goes wrong.
db.barProperty.aggregate([
{
$match: { domainObjectId :…

Bert Roex
- 1
- 1
0
votes
1 answer
Spring MongoDB Reactive: Sorting query and aggregation does not sort results
In short - i try to retrieve a sorted list of objects using both find with Query object
and aggregation object.
But... no luck - randomly ordered lists every time.
I tried two options:
@Component
@RequiredArgsConstructor
public class…

Mike
- 63
- 1
- 7
0
votes
1 answer
Sping MongoDB Reactive - how many change streams is it recommended to have in an application?
I try to study the topic of Spring Reactive and MongoDB change streams.
And i run with quite a lot of change streams as i develop my application (up to 10 so far - but still) - so far so good, but i believe when being used by multiple users it can…

Mike
- 63
- 1
- 7
0
votes
1 answer
How to communicate object changes via Flux to Websockets in Sping MongoDB Reactive
Please, give some hint regarding the following!
Pre-requisites:
Mongo cluster of replica-set type
@EnableReactiveMongoRepositories is in place and all the repositories extend from ReactiveMongoRepository
@EnableWebFluxSecurity is in place, there is…

Mike
- 63
- 1
- 7
0
votes
1 answer
Aggregation works unexpectedly after spring-data-mongo-db library update
Today I updated Spring Boot from version 2.2.2.RELEASE to 2.5.2. After that aggregations started to behave differently. Here is an example query (in kotlin language):
val aggregation = Aggregation.newAggregation(
…

pokemzok
- 1,659
- 1
- 19
- 29
0
votes
0 answers
Bean not found error while using Reactive Mongo with Webflux
I am doing a sample application and trying to use webflux with reactive mongo.
I am getting below error while starting the application in Intellij
required a bean of type 'com.sample.ReservationRepositroy' that could not be found.
I am having below…

vinilpj
- 128
- 2
- 10
0
votes
1 answer
In Spring WebFlux, How to chaining methods from multiple services/repo, in order to 'delete' elements in multiples DB-Collections'?
1) Contextualization about the problem:
I am trying 'delete' items in 03 different DB-Collections(Reactive MongoDB), using 03 different services/repo (userService + postService + userRepo);
My Goal is DELETE an object (in each collection)…

GtdDev
- 748
- 6
- 14
0
votes
0 answers
How to chaining responses from different services, in order to create a Flux Response using 'those responses' in WebFlux?
Contextualization about the problem:
I am trying to chain data from multiple services, in order to aggregate/merge their responses;
My Goal is create a final Flux with a List of objects created from the 'Merged Responses'.
The merging is based on…

GtdDev
- 748
- 6
- 14
0
votes
1 answer
How to Fetch objects, using references from other objects, in Reactive Spring Data?
I'm new to MongoDB and WebFlux. I'm trying to retrieve a 'Post' with its 'Comments'(List listComments) using 'CommentsIds'(List idComments) from this 'Post' POJO:
That's my…

GtdDev
- 748
- 6
- 14
0
votes
1 answer
Trying to manage multiple Flux/Mono, starting a few of them before others, and combining some of them, and getting a bit lost
I have a module that accepts entity IDs and a "resolution type" as parameters, and then gathers data (primarily) asynchronously via multiple operations that return Fluxes. The resolution is broken into multiple (primarily, again) asynchronous…

Steve Storck
- 793
- 6
- 25
0
votes
1 answer
Call 2 different ReactiveMongoRepository under the same spring transaction using @Transactional
Let's have 2 different ReactiveMongoRepository mongo repositories:
@Autowired
private CurrencyRepository currencyRepository;
@Autowired
private CurrencyArchiveRepository currencyArchiveRepository;
And a @Transactional method which call both…

troig
- 7,072
- 4
- 37
- 63
0
votes
1 answer
how to limit the transaction scope with spring data reactive mongodb transactionalOperator
I need to reduce the tx scope for performance reasons. for example
reactiveMongoTemplate.save(a)
.then(
reactiveMongoTemplate.inTransaction().execute(rmo -> methodInTx(rmo, trade))
)
.subscibe()
save(a) not participates the…

ben
- 168
- 6
0
votes
1 answer
Managing the lifecycle of multiple Flux with spring-data-mongodb-reactive
I have a data service and I am seriously considering switching to a reactive model. This is a federated query engine that can resolve data for queries by invoking one or more "resolver" implementations, depending on the query type.
If I switch to…

Steve Storck
- 793
- 6
- 25