3,314 questions
0
votes
0
answers
33
views
Spring boot Handling AWS Secrets Manager rotation handling to connect to AWS DocumentDB
I have a spring boot application deployed on ECS running on 2 tasks. It is fetching username and password from AWS Secrets Manager using AWS SDK and connecting to AWS DocumentDB using spring data ...
0
votes
1
answer
117
views
Issues switching from mongodb to ferretdb in spring boot application
I am trying to ditch mongodb and use ferretdb as a drop in replacement. Now I have tests that were working with testcontainers as testcontainers has first class support for mongodb. I have changed the ...
0
votes
0
answers
20
views
How to access VM args in MongoDB Spring Document annotation
When I try to do the following I get an error. Would like to know if it's possible to access Java system properties or alternatively environment variables exclusively in the @Document annotation to ...
0
votes
1
answer
145
views
How do I serialize a Kotlin LocalDate or LocalDateTime to a BsonDateTime with Spring Data?
I am trying to serialize a model with a LocalDate into a BsonDateTime using Spring Data Mongo. This MongoDB guide for Kotlin usage says that, with the @Serializable and @Contextual annotations, ...
0
votes
1
answer
51
views
Auto set fields in spring data mongodb
I have a Base Entity class which all my Spring Data MongoDB classes extend, I want to have a few basic fields (check below) which need to be auto-set/auto-updated, what's the cleanest way to achieve ...
1
vote
1
answer
92
views
How to intercept a MongoRepository in spring-data-mongodb?
I use spring-data-mongodb in my project. I have some code like that:
@Repository
public interface NameRepository extends MongoRepository<Name, String> {
List<Name> findByStatus(String ...
0
votes
0
answers
74
views
Test tries to connect localhost instead of using embedded mongodb by @DataMongoTest
I have spring app which uses mongoRepository. I want to have an integration to test my repository by using @DataMongoTest. For some reason my test tries to connect localhost for mongo and gets timeout....
2
votes
1
answer
110
views
MongoDB transaction in Kafka Listener has already been closed if exception occurs
I get the following error when using a MongoDB transaction inside @KafkaListener method.
The repository performs an unordered bulk operation (that may fail, but I'm intrested in knowing which ...
-1
votes
1
answer
53
views
Issues with MongoDB Querying Nested Documents Using spring-boot-starter-data-mongodb
I’m encountering some issues when querying nested MongoDB documents using spring-boot-starter-data-mongodb.
After checking, I can confirm that the valid documents are present in MongoDB. Here's an ...
0
votes
0
answers
24
views
join combination in spring-data-mongo for no name list fields
I am using Spring Data Mongo and a Mongo DB, I have to join a field below, please share best approach. I have tried aggregate approach but its giving performance issue.
Collection A
{
"name1"...
0
votes
0
answers
29
views
Why is there no option to upsert with Spring-data-mongodb annotations?
Using mongoTemplate in spring-data-mongodb (3.4.18), I can do
mongoTemplate
.update(MyClass.class)
.matching(query(where(...)))
.apply(new Update()
.set(...)
.setOnInsert(.....
1
vote
1
answer
274
views
No ConnectionDetails found for source @ServiceConnection MongoDBAtlasLocalContainer
I'm attempting to write ITs for a simple reactive service, but the test fails when attempt to obtain the test container (MongoDB Atlas Local) connection.
The error:
Caused by: org.springframework....
0
votes
1
answer
49
views
unable to query date range in mongo repository in spring boot
Mongo document has a field createdOn which stores ISODate i.e. java.util.Date in mongo document
I am trying to get count on date range fields. When I give date range from and to from restclient I am ...
1
vote
1
answer
120
views
How globally configure conversion of `MongoTemplate.getCollection().aggregate()`'s result to POJO?
I know two separate APIs in MongoTemplate, if you want to perform an .aggregate:
By invoking directly functions in MongoTemplate, like MongoTemplate.aggregate()
By using an intermediate getCollection(...
0
votes
0
answers
52
views
@Update with $inc is not working using Spring Data with MongoDB
In a Spring Boot app which uses MongoDB, I have a repository that extends MongoRepository and adds custom methods.
I need to write a method that updates the nested field balance.available incrementing ...