1,044 questions
0
votes
1
answer
67
views
`Filters.eq(fieldName, value)` not actually creating `$eq` causes issues
I'm not sure if this is a MongoDB issue, an issue with the mongo-java-driver or if I'm doing something worng.
The issue is that MongoDB can behave differently in case there is a $eq operator or if a {...
1
vote
1
answer
119
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
44
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
1
answer
96
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
61
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
529
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
122
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
48
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
143
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
179
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
198
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
478
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
66
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&...
0
votes
1
answer
198
views
My Aggregation Query skip,order is not working propery with java
Here is my Java code. skip missing some records. also order is not working.
AggregateIterable<Document> propertiesDoc = collection.aggregate(Arrays.asList(
Aggregates.match(...