Questions tagged [spring-mongodb]

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

Do not use this. Use instead.

422 questions
2
votes
2 answers

spring boot: ClassNotFoundException de.flapdoodle.embed.mongo.distribution.IFeatureAwareVersion

I have an example spring boot project which uses mongo db for persisting objects. I would like to test it with an embedded mongo db but I get an error which is very similar to this question (see comments of the accepted answer): For some reason…
tenticon
  • 2,639
  • 4
  • 32
  • 76
2
votes
1 answer

Springboot data how to make a Query correctly managing NumberLong?

I'm storing elements with a Int64 field in MongoDb. I'm generating a value using all the bigfield and real 64 bits values. Document looks like { fileds... messageUid : -3130564683773456202 } No problem to write this long value with…
disk91
  • 31
  • 1
2
votes
1 answer

How project DBRef on Spring MongoDB Aggregation?

I have the following aggregation done in a MongoDB shell to get the number of alerts of each type for each user: db.getCollection('alerts').aggregate( { $unwind:"$son" }, { $group: { …
Sergio Sánchez Sánchez
  • 1,694
  • 3
  • 28
  • 48
2
votes
0 answers

Spring mongo The attribute lazy is undefined for the annotation type DBRef

I am using mongodb with spring and I added spring-data-mongodb using maven org.springframework.data spring-data-mongodb 1.4.0.RELEASE
Mišel Ademi
  • 187
  • 4
  • 15
2
votes
1 answer

Remove items from array of documents in Spring+Mongo

I have a collection of documents like this in a mongo db : "_id" : ObjectId("592bc37c339e7a23788b4c7c"), "trips" : [ { "tripGcsId" : "5937f86e339e7a2a58ac3186", "tripCounter" : NumberLong(1283), "tripRef" : "hjkhjk" …
neptune
  • 1,211
  • 2
  • 19
  • 32
2
votes
1 answer

Grouping operation on a field and putting the list of the liked field in an array

I am working on a JHipster project with an AngularJS front-end and a Java back-end. I am using Spring data with the MongoDb database. I did a grouping operation on the field budgetCode. So, for each budgetCode, I succeded to have the list of all the…
stephansav
  • 173
  • 1
  • 2
  • 11
2
votes
0 answers

Creating Index in Mongodb with Spring Boot

I'm using Mongodb as persistent layer with Spring Boot. In my project I want to achieve multi-tenant feature with creating a collection for each tenant. E.g. if there are three tenant, I will have 3 user collections: tenant1_user, tenant2_user,…
Cong Wang
  • 769
  • 1
  • 9
  • 30
2
votes
2 answers

How to select between dates Spring data MongoDB using @Query

I'm using Spring data with MongoDB and i need to find between actual day and 7 days ahead. I have create repsoitories with @Query annotation and don't like to user Criteria class. Do you have some idea how to user between with @Query? thanks in…
user6788046
2
votes
2 answers

Spring data-Mongo DB Query embedded array

I have the document in mongo collection called (CustomerInformation) with following structure. { "_id" : ObjectId("58f5e68c8205281d68bbb290"), "_class" : "com.test.dataservices.entity.CustomerInformation", …
2
votes
1 answer

SpringBoot MongoDB returns "Id must be assignable to Serializable! Object of class [null] must be an instance of interface java.io.Serializable"

I tried adding a new collection to my API/DB today, and when I try to POST or GET, I get this 500 error response: { "cause": null, "message": "Id must be assignable to Serializable! Object of class [null] must be an instance of interface…
Kevin Grant
  • 591
  • 6
  • 15
2
votes
1 answer

config auth for spring-mongo-data

Environment spring-boot 1.3.2 spring-mongo 0.8.0 build my spring-boot microservice with gradle. Problem one of mongo database enable the auth,so i configure these arguments in application.yml spring: data: mongo: …
2
votes
1 answer

Superset of fields in all documents in a collection Mongo

How to create a super set of fields(except _id) present in all the documents in a single collection of MongoDB assuming that all documents are of same type but different number of fields. Example : doc1 - {"_id":"test1", "firstName":"sample1",…
2
votes
1 answer

Mongo db java unwind operation in aggregate query throwing exception

When working with embedded mongo document I am trying to unwind the array but I am getting exception like org.springframework.data.mapping.model.MappingInstantiationException: Failed to instantiate java.util.List using constructor NO_CONSTRUCTOR…
Karthik
  • 470
  • 8
  • 25
2
votes
1 answer

Comparing lazy-loaded Spring Data MongoDB entities using equals/hashCode

I have two objects One by lazy loaded product:5757b95d1d8eecdd01e59b29$LazyLoadingProxy The other eager loaded com.entity.Product@5e6c4568 I know both objects are the same since they have the same unique id (id=5757b95d1d8eecdd01e59b29). I…
Saurabh Kumar
  • 16,353
  • 49
  • 133
  • 212
2
votes
2 answers

Query failed with error code 13

I am trying to execute a find function on mongodb and i get ': Query failed with error code 13' error. I have specified the host, port, db, username and password in an appropriate manner. I am unable to find out the issue. The username given in the…
Rahul Vijay
  • 31
  • 1
  • 2
  • 7