Questions tagged [reactive-mongo-java]

34 questions
3
votes
1 answer

Bulk Update with ReactiveMongoTemplate

In a reactive spring boot application, I have a list of items to update. I want to send a SINGLE command to my DB to apply the changes on different items. An equivalent to db.collection.updateMany if I may say. Is it possible? How?
2
votes
0 answers

Java.lang.reflect.InaccessibleObjectException: Unable to make field private final java.lang.String java.io.File.path accessible error in java 17

I am upgrading my application from Spring Boot version 2.7.3 to 3.0.2 and Java version 8 to 17. My build is successful but during server startup I am getting below exception - Caused by:…
2
votes
0 answers

Java Reactive hangs when calling repo operation inside map

I'm new to this reactive world and having an issue when I want to map my user to another user. So the code is supposed to go to DB to find the user based on Username, then will need to create another user object and populate its Authority by calling…
2
votes
1 answer

Spring Webflux Reactive Mongo Bulk Operations (Java)

https://github.com/spring-projects/spring-data-mongodb/issues/2821 https://jira.spring.io/browse/DATAMONGO-1922?redirect=false I have been looking for ReactiveBulk operations to update documents as a batch in Spring WebFlux. Like in the Mongo…
2
votes
0 answers

Spring cache mongodb with Reactive mongo autoconfigure

I am trying to use spring-cache-mongodb as a cache in my reactive spring application. The problem are the 2 depenndencies implementation group: 'org.springframework.boot', name: 'spring-boot-starter-data-mongodb-reactive', version:…
v78
  • 2,803
  • 21
  • 44
2
votes
1 answer

How we can compare two values of flux using springreactor

Currently I am new in reactive programming , I have added data in 2 documents, so currently what I am trying to do is to return only those data to client whose tokenIdentifier is same in both document. Please refer the code below: I have 2…
1
vote
1 answer

How do you throw exceptions within Webflux Mono and Flux streams to the caller?

I have a service that handles the insertion of a new record into a MongoDB collection: public Mono insertProduct(Mono in) { //TODO Must handle Duplicate key inserts --> Throw a ProductAlreadyExistsException …
1
vote
1 answer

saving a Flux of items in reactive mongo db

i'm having a flux of items returned from another service Flux tweetsByUserId = restUtils.getTweetsByUserId(userId); I want this flux to paralamlely be saved in database and send to the rest endpoint to be…
javaworld
  • 427
  • 1
  • 9
  • 19
1
vote
0 answers

NestedClass test failing, because Spring-Data-Mongo-Reactive is closing MongoDb connection (state should be: server session pool is open)

1) Problem Description: I am using a Spring-Data-Mongo-Reactive, Testcontainers and JUnit 05; I have a Test-Class with simple-test and ‘Nested-Test-Class’(which has a simple test, as well); When, JUnit tests the NestedClass, the MongoDb Connection…
1
vote
0 answers

Updating multi level Embedded document in Mongo using reactivemongotemplate

I have an embedded document. How can I update the multilevel document? At the time of insert, using Document to store the document. When updating the embedded document with update.set(), I can only do a string and not as an embedded document(storing…
skasani
  • 11
  • 1
1
vote
1 answer

How count a mongodb collection with ReactiveMongoTemplate without any query filter?

I would like to determine mongodb collection size in my java spring application. I know that reactive rective Mongo Template has a count() method what does that, however it needs a query param. So my solution is: public Mono collectionSize(){ …
LakiGeri
  • 2,046
  • 6
  • 30
  • 56
1
vote
1 answer

MongoDb Java driver reactive with POJO mapping find List of documents in a type safe way

I have a bunch of Document in a Collection and would like to retrieve all of them. This is my situation: I am using the Java Reactive Streams driver I am using the CodecRegistry to get my Document deserialized to my Pojo The problem is that all…
Shankha057
  • 1,296
  • 1
  • 20
  • 38
1
vote
1 answer

how retrieve and add new document to MongoDb collection throw com.mongodb.reactivestreams.client.MongoClient

Context: I coded a Kafka Consumer which receives a simple message and I want to insert it to MongoDb using com.mongodb.reactivestreams.client.MongoClient. Althought I understand my issue is all about how use properly MongoClient let me inform my…
Jim C
  • 3,957
  • 25
  • 85
  • 162
0
votes
1 answer

how to write my mongodb query in springboot reactive mongodb

well below is my implementation db.services_performed.aggregate([{$match:{status:{$in: ["INVOICING","outbound","accepted","PENDING APPROVAL"]}}},{$group:{_id:{date:{$dateToString: …
0
votes
0 answers

Mongo - Find all duplicate docs based on criteria

I have following document { "url": "/some/listing/url", "title": "HOTELS WITH RIVER VIEW IN SALZBURG", "pageType": "LISTING_PAGE", "pageMetaData": { "$placeId": 123, "hotels" : "1,2,3", "priority": 1 } }, { "url":…
Sandeep Nair
  • 436
  • 2
  • 15
1
2 3