Questions tagged [spring-mongodb]

Do not use this. Use [spring-data-mongodb] instead.

Do not use this. Use instead.

422 questions
0
votes
1 answer

Usage of ClassTypeInformation.from(..) inside MappingMongoConverter introduces much thread contention

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…
Alex Paransky
  • 985
  • 2
  • 10
  • 21
0
votes
1 answer

Capture unknown document added during big find query in Mongodb

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…
0
votes
1 answer

Mongodb between query in java

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…
Emil
  • 423
  • 1
  • 12
  • 34
0
votes
2 answers

Spring Mongo mapping variable data

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…
ianaz
  • 2,490
  • 3
  • 28
  • 37
0
votes
0 answers

Issues adding resource file to accessing-data-mongodb

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…
JMS
  • 183
  • 2
  • 9
0
votes
1 answer

Query an element of an array with exactly matching fields MongoDB in Java

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":[ { …
C.Kaya
  • 21
  • 1
  • 4
0
votes
1 answer

MongoDB Aggregation Sum implements on Spring Data

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 } } …
0
votes
1 answer

Mongotemplate group exception

I get NullPointerException when running mongo template group operation. The code looks like this: GroupByResults recommendations = mongoTemplate.group("recommendation", GroupBy.key("doctor"), …
-1
votes
0 answers

find records from mongo using spring mongo template where empId (integer) starts with 1100 only and not with 2200

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() …
Learner
  • 99
  • 3
  • 14
-1
votes
0 answers

How to write below mongo db query in Spring using criteria?

Below is my sample Data set [ { _id: "B1", racks: [ { rackId: 1, options: [ { optionId: 1, status: "FREE" }, { optionId: 2, status: "FREE" …
-1
votes
1 answer

I am trying to convert some Strings I received from my mongodb collection into a java date object. But I can't seem to find a pattern that works

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…
-1
votes
1 answer

How to read millions of records from spring MongoDB and process it

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…
-1
votes
1 answer

Spring Webflux Wait for a Flux inside a Flux

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…
-1
votes
1 answer

Getting MappingException while deserialzing an array of objects in spring mongo connector

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": [ { …
-1
votes
1 answer

MongoDB Query: $all with nested property

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…
J.Hasler
  • 1
  • 1
1 2 3
28
29