32 questions
0
votes
1
answer
249
views
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:{...
2
votes
0
answers
812
views
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: org....
1
vote
1
answer
1k
views
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<ProductDto> insertProduct(Mono<ProductDto> in) {
//TODO Must handle Duplicate key ...
0
votes
1
answer
423
views
MongoDb async/insertData, sync/getData: using ReactiveMongoTemplate
I have a situation where I need to insert in async and get data (obviously it should be in sync) currenlty am using ReactiveMongoTemplate
//insert async
reactiveMongoTemplate.save(MyObject)
// get ...
0
votes
1
answer
533
views
Why filtering does not work with Spring Boot and MongoDB
Why filtering by import_created_at does not work?
I have a Spring Boot Application and MongoDB as database.
I have Mongo collection items and 2 documents there:
{
"_id": {
"...
0
votes
1
answer
228
views
ReactiveMongoRepository insert return converter
Insertion of an entity with an Instant value, using ReactiveMongoRepository:
MyEntity inserted = myReactiveMongoRepository.insert(entity).block();
System.out.println("inserted.getSent() = " +...
1
vote
1
answer
1k
views
saving a Flux of items in reactive mongo db
i'm having a flux of items returned from another service
Flux<Tweet> tweetsByUserId = restUtils.getTweetsByUserId(userId);
I want this flux to paralamlely be saved in database and send to the ...
2
votes
0
answers
372
views
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 ...
2
votes
1
answer
2k
views
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 ...
1
vote
0
answers
663
views
Why MongoDB Atlas does not work with reactive Spring Data and Spring Boot?
I'm developing an easy sample application. One component is a gateway service using Spring Boot and Reactive Spring Data for Mongo, because that's where I want to store user and login informations.
...
0
votes
1
answer
958
views
org/bson/internal/CodecRegistryHelper with Micronaut data MongoDB
Using the latest Micronaut 3.4.1 with micronaut data and MongoDB. Keep getting the exception as java.lang.NoClassDefFoundError: org/bson/internal/CodecRegistryHelper
Gradle Dependencies
dependencies {
...
0
votes
1
answer
291
views
How Can I do “the same UPDATE-METHOD” updates 02 Collections “at the same time” using Spring Data ReactiveMongoTemplate?
1) Problem Description:
I am using a Reactive Spring-Data + Spring WebFlux + MongoDb + ReactiveMongoTemplate;
I have 02 Collections: Task and Project
2) My Goal is:
Using only “one update method”
...
3
votes
1
answer
2k
views
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 ...
2
votes
0
answers
590
views
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, ...
0
votes
1
answer
2k
views
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 ...
0
votes
1
answer
791
views
Quarkus Mongodb change stream NullPointerException in native build
I'm building a quarkus app tha use the mongodb change streams functionality with the reactive client.
If I start the application locally from Intellij everything works fine but when I build the native ...
0
votes
1
answer
1k
views
Problem Parsing request body of type json, containing a list of string to Flux of string in Spring reactive
I have a DTO as below:
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import reactor.core.publisher.Flux;
@Data
@NoArgsConstructor
@AllArgsConstructor
public ...
-3
votes
2
answers
95
views
Unable to convert date with UTC using Joda Time API [closed]
I'm trying to convert this date into local date
Input: "2021-04-20T15:00:00+02:00";
Expected output: "2021-04-20T13:00:00Z";
Actual output : "2021-04-20T15:00:00
Can you ...
0
votes
1
answer
365
views
Springboot ignores the MongoDB atlas uri, trying to connect hosts=[127.0.0.1:27017]
I have been working in a application with Spring webflux and reactive mongo DB. in there i used mongo DB atlas as the database and it worked fine.
Recently i had to introduce mongo custom conversion ...
2
votes
0
answers
483
views
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-...
0
votes
0
answers
169
views
Filtering on a Mongo DB capped Collection using Flux
I have defined my capped collection as below.
@Document("#{@environment.getProperty('customProperties.cappedCollection')}")
@Data
@NoArgsConstructor
@Builder
@AllArgsConstructor
public ...
0
votes
0
answers
517
views
SpringBoot test: NoSuchBeanDefinitionException for ReactiveMongoRepository
I'm trying to test service-class of reactive mongoDB application, created on SpringBoot.
I don't use embedded mongodb! I'm only trying to mock repository
This is reactive mongo repository:
package com....
1
vote
0
answers
41
views
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 ...
0
votes
1
answer
537
views
Mongo bulk replace with 200k+ operations
E.g. I have such documents in the collection:
{
"key": "key1",
"time": 1000,
"values": [] // this one is optional
}
I need to update the collection ...
-1
votes
1
answer
325
views
Cannot convert from Flux<A> to Mono<? extends Object>
public Flux<A> updateByFindById(String gsisKey, A a) {
return repository.findAllByVesselCode(a.getVesselCode())
.collectList().flatMap(list->{
return ...
0
votes
1
answer
60
views
What is the order of saving objects of a Model class?
I have an POJO class for a JSON as follows:
public class Portcall {
private Long id;
.
.
PreviousPortCall previousPortCall;
NextPortCall nextPortCall;
.
}
Here all the 3 classes-...
2
votes
1
answer
3k
views
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....
1
vote
1
answer
2k
views
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 ...
1
vote
1
answer
2k
views
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 ...
0
votes
0
answers
999
views
Change MongoDb ObjectId _id to string in Micronaut using java
I have below Pojo class for the mongo entity
public class Product {
@BsonProperty("_id")
@BsonId
private ObjectId id;
private String name;
private float price;
...
1
vote
1
answer
1k
views
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 ...
2
votes
1
answer
1k
views
Spring Boot MongoDB: reactivestreams driver always uses the default localhost instead of URI
I have a java Spring-Boot application that connects to an external MongoDB server. Whenever I start the application I see two clusters created:
[ Test worker] org.mongodb.driver.cluster ...