1,046 questions
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(...
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,
...
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....
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
@...
-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 ...
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 ...
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 ...
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-...
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&...
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 ...
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 ...
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 (...
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":...
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 ...
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&...