Skip to main content
Filter by
Sorted by
Tagged with
0 votes
0 answers
64 views

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....
user1474111's user avatar
  • 1,536
0 votes
1 answer
78 views

First disclaim: I've already seen these topics ==> Spring MongoRepository very slow to convert POJO ==> performance issue on Spring Data Mongodb I clearly have a similar problem, but nothing in ...
Antoine's user avatar
  • 191
0 votes
1 answer
184 views

I understand that when using transactions in MongoDB with the WiredTiger storage engine, the isolation level is fixed to snapshot. If I use @Transactional(readOnly = true), it allows consistent reads ...
backtony's user avatar
0 votes
0 answers
279 views

I am using below mongo aggregation pipeline in spring boot java to update document in mongodb. Below is the raw mongo query that works fine when executed directly on mongodb db.lock.aggregate([ {...
Reena Upadhyay's user avatar
0 votes
1 answer
221 views

I have a list of objects of type MyObject, and I wish to insert an object if its not present in the mongo collection, or update if it does. MyObject contains multiple fields, but I want to update if ...
ranban282's user avatar
  • 186
0 votes
1 answer
612 views

I have a list of records. Each record needs to have 2 fields: temp(temperature in Celcius) and temp_F(temperature in Fahrenheit). temp field is available in mostly all records. But temp_F is missing ...
Kanhaiya's user avatar
  • 394
0 votes
1 answer
128 views

I have a school project that needs to support different db at runtime, when only one is selected and is active (a feature to change db after one is selected is not needed). I've been doing some ...
Atram's user avatar
  • 11
0 votes
1 answer
344 views

I have this console query: db.testcol.find({ $expr: { $lte: [ { $toDouble: "$someField" }, 5 ] } }) I want to write it programmatically using Criteria so I can do the following: ...
italktothewind's user avatar
0 votes
1 answer
83 views

Trying to update element by id = 1234567890 and id= 8888888888 and .. (bulk) inside nested array es in the example below { "name": "template", "process": [ { ...
VitalyT's user avatar
  • 1,701
0 votes
1 answer
311 views

I just add MongoDB configuration to the existing Spring Boot application, some test class has @SpringBootTest annotation, and those classes throw exceptions that says I need to define embedded MongoDB ...
fuat's user avatar
  • 1,902
0 votes
1 answer
634 views

I have my MongoDB query which returns the expected Data but I'm struggling to translate it with Spring (org.springframework.data.mongodb.core.MongoTemplate). Let's say in my collection A I have this ...
Barbi's user avatar
  • 188
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
2 votes
0 answers
811 views

I am upgrading my application from Spring Boot version 2.7.3 to 3.0.2 and Java version 8 to 17. My build is successful but during server startup I am getting below exception - Caused by: org....
Bhagyashree Kalshetti's user avatar
0 votes
1 answer
131 views

I have problem to save data to mongodb is always null. The data is from redis message publisher that i want to save as a consumer. I hope get the solution. Thanks Service @Slf4j @Service @...
helsaKidsCom's user avatar
1 vote
1 answer
3k views

For an assignment I have to write a query with multiple OR conditions. If I had to write it using MongoDB Query Language it would be trivial { $and : [ { $or : [ { "field1" : "value1&...
Olivier Tonglet's user avatar
0 votes
1 answer
203 views

I'm trying to write a Java code for below MongoDB command using MongoTemplate and Criteria and Trim function on the field value in Mongo collection db.employees.aggregate([ { $match : {$...
lucky's user avatar
  • 51
0 votes
1 answer
2k views

We are injecting the mongotemplate using the spring config <mongo:mongo-client id="mongoClient" connection-string="${mongodb.connect-string}"> <mongo:client-settings ...
ksnstacks's user avatar
0 votes
1 answer
1k views

When trying to just make sure the connect is working, this error arises. Error that pops up This is the connect string, Connection string This is my aapp.properties, spring.data.mongodb.uri=mongodb+...
James Cervantes's user avatar
0 votes
2 answers
643 views

I was finding on the internet how to update all the document field values with lowercase. I luckily found a query which I modified as per my requirement and it is working correctly. db.messages....
Shrey Soni's user avatar
1 vote
1 answer
1k views

I have created a spring boot application needed for querying and posting to a MongoDB database, I have created a data model that is to be submitted from a website, as well as a service to auto ...
Vincent Banks's user avatar
1 vote
0 answers
488 views

this is my mongo db document classA { private String name; private long elapsedTime; // newly added field } @Document classB extends classA{ private String id; private String owner; } ...
mr.Nobody's user avatar
  • 165
0 votes
1 answer
37 views

I have the following document : { _ids : ... market : ... contractorName : ... field :... amount : ... } and i want to group it first by market then group the result by field (sum of amounts) ...
Youssef Idraiss's user avatar
0 votes
1 answer
128 views

I am trying to get count of likes and if user is liked this post in Mongo. I managed to get this via native query with facets, but problems is how can i map this two fields on my custom java class (...
Evgeny Kuznetsov's user avatar
0 votes
2 answers
848 views

I have a collection: public class Person { private String name; private Integer age; } I want to delete field age in all the documents. So the schema gonna look like that: public class Person { ...
stakeika's user avatar
  • 125
3 votes
2 answers
4k views

I'm new in mongodb. Could you please tell me how to perform join operation in this. I've two collection: Collection 1 ("user") { _id: "d04d53dc-fb88-433e-a1c5-dd41a68d7655", ...
Md Enayat's user avatar
  • 167

1
2 3 4 5
9