65 questions
0
votes
1
answer
105
views
process reactive query result concurrently
I need to iterate over a massive query result and perform some business logic on each entity. The database is connected with Spring Data Mongo Reactive so I get a Flux<Entity>.
The simple ...
0
votes
0
answers
74
views
Spring boot 3 Webflux Mongo connection leaks
We had an application with spring boot 2 without problems.
After upgrade it on spring boot 3 we have problem with connections to mongodb.
Our checkedout connections piling up to maxPoolSize and then ...
1
vote
1
answer
518
views
CustomConverter do not get applied for ReactiveMongoTemplate
Hello Spring community,
I have a Spring Boot 3 application with a Mongo DB. I use Spring data mongo reactive to communicate with the database and that works great apart from this issue.
I have a ...
3
votes
1
answer
45
views
How can I filter sub-documents from MongoDB with SpringBoot?
I have documents in a collection such as :
{
"login":"xxx",
"someAttribute":"someValue",
"subDocs":[
{
"data": "val1&...
2
votes
0
answers
220
views
What are MongoManagedTypes - new in spring-data-mongodb version 4.0
In MyMongoConfig extends AbstractReactiveMongoConfiguration I created a bean when using version 3.2 of spring-data-mongodb:
@Override
public MongoMappingContext mongoMappingContext(...
2
votes
1
answer
677
views
spring data mongo reactive throw org.springframework.data.mapping.MappingException when eager loading nested @DbRef
Basically, I have a User collection that contains a @DbRef to UserPlot (plots) collection. Inside UserPlot, I also have a @DbRef to Plot (plot). My goal is to find all users and eagerly load plots to ...
1
vote
0
answers
157
views
Cannot convert a String to Decimal128 in @Query usgin Spel
I'm trying to do a convertion from String to Decimal128 in a @Query to perform a paging operation using the following snippet:
public interface ExpenseCollectionRepository extends ...
1
vote
2
answers
1k
views
Spring data reactive MongoDB Null reference when acessing object from documents link @DocumentReference
I would like your help. I'm working with Spring reactive (WebFlux) and mongoDB also reactive.
In my model I have an association of two entities: User and Post. Modeling the problem, 1 User has a list ...
0
votes
1
answer
495
views
How to map array of objects to array of plain values in Spring Data Mongo
I have a collections of documents, which have an inner array of objects with two fields:
{
"state" : [
{
"date" : ISODate("2022-08-06T00:56:29.615Z&...
0
votes
0
answers
1k
views
How to disable auto creation of db and collection in spring data mongodb?
I am working on a spring boot project which uses spring data mongodb. Spring data mongodb auto creates the db and collection when it doesn't exists. I want to disable auto creation of db and ...
2
votes
1
answer
9k
views
Timed out after 30000 ms while waiting for a server that matches ReadPreferenceServerSelector{readPreference=primary}
I'm using reactive mongodb within a spring boot application, but I get the errors bellow:
org.springframework.data.mongodb.core.ReactiveMongoTemplate - Streaming aggregation: [{ "$match" : { ...
1
vote
0
answers
113
views
Can Reactive Mongo Template execute MergeOperation?
I want to know if it is possible to execute MergeOperation snippet:
MergeOperation mergeOperation = Aggregation.merge()
.intoCollection("someCollection")
.on("_id")
...
2
votes
0
answers
891
views
How do i put multiple conditions inside spring data mongodb aggregation filter?
Mongodb states that it is possible to put multiple conditions inside cond of filter. Like this:
{
$filter: {
input: [ 1, "a", 2, null, 3.1, NumberLong(4), "5" ],
as: &...
0
votes
1
answer
232
views
Mongo Replicaset monitoring replaces hostnames with IP and leads to failed hostname verification
we have a problem with the mongo java driver and the monitoring thread.
We are running a 3 server replicaset and connect our spring boot microservices by using the hostnames.
mongodb://<username>...
1
vote
1
answer
877
views
Use $function (javascript) in mongo repository @Aggregation pipeline
I have the below query that runs fine in mongo shell. I have to use this from my spring boot java application.
db.UserGames.aggregate([
{ $match: {$and: [{timestamp: {$gte : ...
0
votes
1
answer
653
views
Spring Data Reactive Mongo Operator how to call unset operation on nested field after performing lookup stage in an aggregate pipleine
I am merging records from two collections projects and card_types in an aggregation pipeline and then trying to remove the cardFields field of the merged record from the result. So the idea is that ...
1
vote
0
answers
231
views
How to paginate an embedded documents in mongodb
I've a project based on a mongodb database and I need to accomplish the following description in a very optimized way. My database has a Document with another embedded documents and I need to apply ...
1
vote
1
answer
249
views
How to get distinct Items by one field in MongoDB using @Query annotation with pagination enabled
I'm trying to get the list of distinct items by a specific field (userId). Currently I'm using this kind of approach to get records from MongoDB using ReactiveCrudRepository. Additionally, I want this ...
1
vote
0
answers
564
views
Kotlin suspend function in Reactive Data Repositores return null
I am facing a "problem" with mongo reactive repositories. I am trying to use kotlin's coroutines and instead of writing fun declaration like this:
fun findEntityById(id: String) : Mono<...
0
votes
1
answer
1k
views
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
@...
1
vote
0
answers
865
views
Spring WebFlux Reactive MongoDB - how to combine two change streams?
In my app i want to combine 2 change streams to listen to changes to some filter object and to the inserts/deletes to the collection which is actually in question (to which i apply the filter residing ...
0
votes
1
answer
239
views
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 ...
4
votes
1
answer
3k
views
FluxUsingWhen cannot be cast to Iterable error when using spring data rest with reactive repository
I configured a ReactiveSortingRepository to see the reactive capabilities on spring data rest, in the past I've mostly used PagingAndSortingRepository to expose resources as REST endpoints so wanted ...
0
votes
0
answers
260
views
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....
6
votes
0
answers
320
views
Bulk operations using spring-data-mongodb-reactive
Is it possible to perform MongoDB bulk operations (like update/upsert) using ReactiveMongoTemplate or spring-data-mongodb-reactive?