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…
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…
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:
{
…
I have a collection of documents like this in a mongo db :
"_id" : ObjectId("592bc37c339e7a23788b4c7c"),
"trips" : [
{
"tripGcsId" : "5937f86e339e7a2a58ac3186",
"tripCounter" : NumberLong(1283),
"tripRef" : "hjkhjk"
…
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…
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,…
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…
I have the document in mongo collection called (CustomerInformation)
with following structure.
{ "_id" : ObjectId("58f5e68c8205281d68bbb290"),
"_class" : "com.test.dataservices.entity.CustomerInformation",
…
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…
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:
…
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",…
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…
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…
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…