Skip to main content
1 vote
1 answer
91 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(...
Andrei's user avatar
  • 1,447
0 votes
0 answers
38 views

How to view the complete aggregation statement when using spring data mongodb?

I just started using spring data mongodb aggregation query. fun findRoot(): MarkdownMongoDocument? { val aggregation = Aggregation.newAggregation( MarkdownMongoDocument::class.java, ...
SageJustus's user avatar
  • 1,114
0 votes
0 answers
32 views

Utilizing ConvertOperators in an aggregation pipeline

I am using the below code. It works exactly as I intend it to. List<Bson> aggregatePipeline = Arrays.asList( Aggregates.match(Filters.and( Filters.gte(ACTIVITY_DATE, job....
Tyler MacMillan's user avatar
0 votes
1 answer
77 views

Quarkus MongoDB returns date 1970 if Java type is OffsetDateTime

MongoDB validation schema: bsonType: "object", required: ["createdAt"], properties: { createdAt: { bsonType: "date" } } Java class: @Getter @Setter @...
Politechniczny's user avatar
-1 votes
1 answer
53 views

How to only get the last item of an array in MongoDB Document using Java/Kotlin

How to only get the last item of an array in MongoDB Document using MongoDB Java or Kotlin driver Without loading the whole document or the list which can be very long Let's say we have this data ...
Eel's user avatar
  • 1,449
1 vote
0 answers
448 views

Spring boot Mongo Data run long Transactional Method throw expceiton MongoCommandException: Command failed with error 251 (NoSuchTransaction)

I am currently utilizing Spring Boot 2.7.18 alongside the MongoDB sync driver. Within my codebase, there exists a transactional method called "updateCertCacheCollectionOld." This method is ...
user12724275's user avatar
0 votes
0 answers
963 views

MongoDB Command failed with error 91(shutDownInProgress)

We have mongo cluster which is a 3 node replicaset and we connect the cluster using Spring boot app. This cluster have a daily maintenance window of 20-30 sec during which one of the node goes down ...
Smith's user avatar
  • 151
0 votes
0 answers
103 views

Getting SSL error, while connecting to MongoDB via Java SDK, but works with Mongo Compass

Trying to connect to ec2-hosted mongodb replicaSet from my local machine. I am able to connect successfully via MongoDB Compass, but getting SSLException error when doing via debzium-mongo-source-...
Ritik's user avatar
  • 61
0 votes
1 answer
46 views

MongoDb Java using sum() in Aggregations with literal value (not with reference)

This Java statement Aggregation.group("name").sum("1").as("count") generates {"$group" : { "_id": "$name", "count": { "$sum&...
Martin's user avatar
  • 1,550
0 votes
1 answer
1k views

Custom converter spring data mongodb

I'm trying to implement mu custom converter to be used in a specific find méthode. So i implemented another mongoConfig with a custom mongoTemplate uses my custom converter as bellow. Here my ...
BARHOUMI's user avatar
  • 214
1 vote
1 answer
121 views

Show storage engine config in mongosh

I've created a collection (in Java) with storage engine options where the block compressor should be zstd. How can I verify that .storageEngineOptions() worked as expected? Is it possible through ...
Jonas Byström's user avatar
0 votes
1 answer
171 views

Java driver - BSON filter check if record is deleted?

I am trying to get valid records from mongodb using Spring - mongodb - java driver my question is around the creation of the Bson filter I am looking for matching records that match some filter (...
JavaSheriff's user avatar
  • 7,715
0 votes
1 answer
190 views

How to get property value direct from mongodb in JAVA

Hi everyone I have a collection of documents like bellow. I want to directly get "rights" from roles array for params: _id, groups._id, roles._id using java mongo driver. { "_id":...
Bojan Stojković's user avatar
0 votes
1 answer
452 views

Upgrading mongo-java-driver to Version 3.9.1

I am in the midst of upgrading the Spring version of one of our projects. As a result of this, the MongoDB library also had to be upgraded. I am not able to track what the previous version of the ...
waffledood's user avatar
0 votes
0 answers
61 views

Get document from MongoDB containing all fields but only includes the first element of an array field

Consider a MongoDB collection with documents as follows: [{ "_id": "123", "name": "Bob", "age": 23, "properties": ["a&...
Paul Jose's user avatar

15 30 50 per page
1
2 3 4 5
70