Skip to main content
Stack Overflow for Teams is now Stack Internal: See how we’re powering the human intelligence layer of enterprise AI. Read more >
Filter by
Sorted by
Tagged with
1 vote
1 answer
119 views

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
43 views

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

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

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,469
1 vote
0 answers
528 views

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
117 views

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
48 views

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

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
143 views

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
179 views

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,741
0 votes
1 answer
198 views

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
472 views

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
62 views

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

Here is my Java code. skip missing some records. also order is not working. AggregateIterable<Document> propertiesDoc = collection.aggregate(Arrays.asList( Aggregates.match(...
Lavan Giri's user avatar
2 votes
1 answer
530 views

I have MongoDB Document parameter of type "real" number but is represented in the DB as a string- e.g "cId"="200" instead of "cId"=200I have to query the DB for ...
user1843591's user avatar
  • 1,166
1 vote
2 answers
1k views

I'm using spring-boot-starter-data-mongodb-reactive along with spring-cloud-vault-config-databases for dynamic secret rotations. Whenever the secret lease expires, I need to manually update the ...
Sebastian Ullrich's user avatar
6 votes
0 answers
402 views

We have a mongo db replica set configuration with 1 primary and 2 secondaries. We have set the read preference to primary because one of our secondary is in a remote region and do not want read ...
Crusaderpyro's user avatar
  • 2,332
0 votes
2 answers
506 views

I have an existing collection, containing several documents: [{ "_id": "1", "someArray": [ { "_id": "1.1" &...
Eria's user avatar
  • 3,253
0 votes
0 answers
757 views

I am looking for a way to update a document replacing a substring of a field with another value. For example, in my database i have the following field: { "_id": 1, "value":...
Alessandro Valentino's user avatar
0 votes
1 answer
284 views

I have code in Java that performs an aggregation pipeline roughly: List<Bson> aggUpdate = Arrays.asList( match(...), project(...), lookup(...), ... merge(...) ); AggregateIterable&...
Robert's user avatar
  • 1,372
0 votes
2 answers
904 views

Hello I am using MONGODB java driver version 4.5.1, I created a method to query a document and grab a specific field. (id is a discord id not document _id) final MONGODB mongodb = new MONGODB(); ...
Vincent Banks's user avatar
0 votes
1 answer
475 views

We have requirement to execute replaceOne operation with db.runCommand() I checked list of commands from here, but i haven't found any command to replace one document. Can someone please suggest us ...
Abhishek Kumar's user avatar
0 votes
1 answer
3k views

I installed 4.4 version MongoDB and reproduced replica set, sharding for my Java application. Now, I am looking for the approach of run MongoDB shell command in my Java application for check and ...
leeyounsoo's user avatar
1 vote
1 answer
680 views

I have a method that generates an alphanumeric sequence based on a particular pattern. I want to save the generated sequence and when next I want to generate a new one, it should start from the last ...
Curious's user avatar
  • 82
-1 votes
1 answer
377 views

In DAO class I use with Morphia I have replaced the String filed type to enums.Currency and I expect that everything will work fine, when the data is retrieved from the db: was public String ...
Eljah's user avatar
  • 5,413
0 votes
1 answer
700 views

I'm trying to use POJOs to write data to MongoDB, but I can't seem to get it working. I have a lot of different data structures because I'm storing various types of chart data. Let's start with the ...
John Manko's user avatar
  • 1,972
0 votes
1 answer
2k views

I am currently working on an application connected to a MongoDB instance. I am having trouble where the 'id' field of my object is not being returned to me within the application but is being returned ...
cbilke1994's user avatar
0 votes
1 answer
7k views

We have recently moved to mongo java driver core/sync 4.4.0 from 3.12.1 with spring data mongo db from 2.2.5.RELEASE to 3.3.0 also spring boot version 2.6.2 and mongo server version 4.2.5 We are ...
Rohit Shete's user avatar
0 votes
3 answers
1k views

I am trying to save the following Java object as a document in MongoDB, here are my classes: public class GenericIpConfig { String connection_type; String port; String port_ingenico; ...
joe1531's user avatar
  • 534
2 votes
1 answer
4k views

I have java application based on mongo server 4.2 and component versions are as follows spring-boot 2.2.5.RELEASE spring-data-mongodb2.2.5.RELEASE mongo-java-driver3.12.1 I updated spring boot to 2.5....
Rohit Shete's user avatar
1 vote
1 answer
158 views

I'm using Mongo db java driver in order to perform some actions on my Mongo db server via my app. when running my jar, the mongo db driver prints his logs to the screen. I would like to stop the ...
Tal Levi's user avatar
  • 915
0 votes
0 answers
51 views

I'm using mongoDB to store and read data from my Java application. My application, in addition to working with the MongoDB database, works with an API for sending messages via whatsapp. Everything is ...
Vitor Patricio's user avatar
0 votes
1 answer
371 views

I am using the codec for the serialization and deserialization of POJO using 4.3/driver-reactive http://mongodb.github.io/mongo-java-driver/4.3/driver-reactive/getting-started/quick-start-pojo/ @...
San Jaisy's user avatar
  • 17.4k
1 vote
0 answers
729 views

I have register codec registry for POJOs as below @Singleton public record Repository(MongodbConfiguration mongodbConfiguration) implements IRepository { @Override public <T> ...
San Jaisy's user avatar
  • 17.4k
0 votes
0 answers
297 views

I'm trying to implement the life cycle events of a Java Reactive Streams MongoDB driver with Micronaut 3 application. There is a requirement to perform BeforeInsert(), AfterInsert(), BeforeUpdate(), ...
San Jaisy's user avatar
  • 17.4k
1 vote
1 answer
890 views

We run into an odd problem when using Azure Cosmos DB with MongoDB API (4.0) and transactions. When we run exactly 20 parallel requests that all open a transaction that is read-only (no modifications),...
der.Schtefan's user avatar
0 votes
0 answers
406 views

I have collection of 5 million records and every time data refresh happens , i wanted to delete Approx. 1 Million records. I am using below java code but it taking 30 Sec to delete. that is to high ...
Bhavesh Modi's user avatar
0 votes
1 answer
431 views

I'm doing a perf test to analyze the performance of a application which uses the MongoDB. The application is written in java and it uses the MongoDB java driver to connect to cloud MongoDB instance. I ...
Vajira Prabuddhaka's user avatar
0 votes
0 answers
80 views

This ticket makes it seem like it is possible to kill Java queries via session identifier. https://jira.mongodb.org/browse/JAVA-1109 Does anyone know the relevant API in order to achieve this?
Walton's user avatar
  • 197
0 votes
0 answers
289 views

I want to get bulk write metrics from Mongo server, like count of insertions, deletions, modifications, but the following methods always return 0. BulkWriteResult.getInsertedCount() BulkWriteResult....
Sumit Aich's user avatar
0 votes
1 answer
380 views

How do we create client certificate to get validated by aws document db?In aws docs https://docs.aws.amazon.com/documentdb/latest/developerguide/connect_programmatically.html#connect_programmatically-...
prathyusha magam's user avatar
1 vote
1 answer
2k views

For my project I use Morphia, for easily mapping POJO objects to the Mongodb database. But in 2018 the mongo java driver started supporting pojo mapping it self and the Morphia project was abandoned ...
Bit33's user avatar
  • 368
2 votes
2 answers
2k views

I'm new to MongoDB and getting a bit crazy here. I'm using the latest mongo-java-driver version and dropwizard. I use POJO to write to the DDBB, which works. However, when trying to get the element, I ...
Adrian's user avatar
  • 198
1 vote
0 answers
607 views

There are millions of exceptions for cursor closed in our application. Cursor has been closed; nested exception is com.mongodb.MongoException: Cursor has been closed It happens when for a moment ...
Arjun Lajpal's user avatar
0 votes
0 answers
418 views

What i want I want to store a pojo with a list of objects as a json object into a collection. I do not know what objects are getting inserted into my pojo, thats why i need to keep it as generic as ...
genaray's user avatar
  • 1,210
1 vote
2 answers
519 views

How can I find the number of duplicates in each document in Java-MongoDB I have collection like this. Collection example: { "_id": { "$oid": "...
Kamijou's user avatar
  • 39
1 vote
1 answer
1k views

I have many documents in collection So,How I can count documents in collection
Kamijou's user avatar
  • 39
1 vote
2 answers
2k views

I am using Micronaut framework with JAVA and trying to validate the objectId with the below string. 60236833af6a1d49478d2bef // Valid mongo ObjectId 60236833a46a1d49478d2bef // Invalid mongo ...
San Jaisy's user avatar
  • 17.4k
0 votes
1 answer
1k views

I have a collection called Users, which contains an array called skills. I use the following code to unwind the skills array and count the number of documents associated with each skill: Bson uw = ...
Morteza's user avatar
0 votes
1 answer
1k views

I am new to java and Mongo I am trying to set a max pool size of 100 I am running Load test in localhost I am seeing that the pool is getting re-used without any issues but the max pool size is not ...
Ram Null's user avatar

1
2 3 4 5
21