I am writing an application which is storing a lot of objects into MongoDB via Spring Data's MongoTemplate. In order to avoid synchronization, I am creating a separate MongoTemplate for each thread. In fact, each thread get's it's own just about…
I was wondering Spring Mongo API for find loads everything in a List. If search result contains billion records, would it not affect memory? Can someone suggest a better way of achieving this without loading all this in memory. Using limit can help…
i want to read all records that are between col1(value) and col2(value) in mongodb. so i write this code but it not work correctly. How implement this query?
my entity is : in my entity i suppose date as long because day or month no important for…
I'm using Spring Data MongoDB for my project. I work with a mongo database containing a lot of data, and I want to map this data within my Java application.
The problem I have is that some data back in time had a different structure.
For example…
I am trying to use this Spring Boot MonogoDB example but I wanted to change the location of the monogoDB server.
http://spring.io/guides/gs/accessing-data-mongodb/
I added the following line to…
I would like to query a one/more matching fields of an array elements(can include subdocuments too) that is into document.
For example:
My collection includes documents below:
{
"_id": 1,
"index": 1,
"elements":[
{
…
The HOUR_COUNTS collections contains {docId, hour, count}
It's very easy for me to get the sum of the count of docId by using the following mongodb query:
db.HOUR_COUNTS.aggregate(
[
{
$match: { hour: { $gte: 10 } }
…
I get NullPointerException when running mongo template group operation.
The code looks like this:
GroupByResults recommendations
= mongoTemplate.group("recommendation",
GroupBy.key("doctor"),
…
find records from mongo using spring mongo template where empId (integer) starts with 1100 only and not with 2200
tried regex but it's not returning results when I tried in compass nor from spring project.
Query query = new Query()
…
I want to convert values from my mongoDB format into a java Date object(LocalDateTime would also be fine). But I can't find the pattern that does the job.
My 'lastupdated' value inside the mongodb collection is like this.
lastupdated : "2015-08-26…
I am working on a project where I need to migrate MongoDB fields to GC storage. There is a total of 5million documents in MongoDB from which I need to transfer some fields to GC storage. I want to know is there any efficient way to read for eg: the…
Here is the scenario, i Have a Flux that comes from a ReactiveMongoDB and another from WebClient, soo
i need that for each item in Mongodb, I look for his items in a webclient.
The problem is that, i have been using block to wait from the webclient…
I have a POJO
public class Model {
String name;
}
public class MyClass {
@id
String _id;
ArrayList models;
}
I am trying to add another entry in the models array with this json -
{
"models": [
{
…
Hello I need some help with MongoDB:
My Document has the following property (generated by an Map with spring):
"filter":{"billingAccount_id":["multisim5"],"simulate":["true"]}
and i'm trying to find the document with the this code (generated by…