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",
userName: "XYZ User",
age: 12
}
Collection 2 ("square")
{
_id:…
As you know, when using spring boot jpa module, below codes in application.properties import pre-defined sql data to rdb.
spring.datasource.initialization-mode = always
spring.datasource.data = classpath:/sql/spring-boot-mysql.sql
But when using…
I am trying simple CRUD on my mongo server and I am getting this one
com.mongodb.MongoTimeoutException: Timed out after 30000 ms while
waiting for a server that matches WritableServerSelector. Client view
of cluster state is…
I am trying to run aggregation pipeline in a spring boot project using MongoTemplate and aggregation framework.
My query executes without any exception. But when I try to call the getMappedResults() on the AggregationResults instance, it always…
I am working on a simple chat service ran by Spring Boot 2.1.1 with WebFlux, Reactor 3.2.3, Mongo 3.8.2 and Netty 4.1.31.
Each chat room has 2 collections - messages archive and a capped collection with current events (eg. new message event, user…
I am working on Spring Kafka Mongo Integration for insert/update operations and using mongotemplate to perform these actions. I want to know is there any way to check mongodb connection is up/down so that in case my db goes down I want to commit…
I would like to store some configuration related classes in the same mongo collection. Thereby I have 2 different objects.
@Document(Collection="config")
public class Config {...}
and
@Document(Collection="config")
public class ActiveFieldsConfig…
Using aggregation pipeline in spring Data, I have documents with nested arrays, and I want to project an array except the last item of it.
for example for each document like :
{
"_id" : ObjectId("59ce411c2708c97154d13150"),
"doc1" : [
…
Using Spring boot 1.5.6.RELEASE.
I have the following mongo document base class:
@Document(collection="validation_commercial")
public abstract class Tier {
@Id
private String id;
@DateTimeFormat(iso = DateTimeFormat.ISO.DATE_TIME)
…
I have a SpringBoot project with Mongo DB connection, application is working fine, but Junits are failing with below exception when mongoTemplate.find(query, SchedulerEntity.class) is called in Impl class.
Am I missing anything here?
I have used…
I have nested collection inside a java spring mongodb object. Can I sort the nested collection based on the values it hold?
class A {
List blist;
..
}
class B {
String date;
}
So here, I want to sort the blist collection based on the date. Is…
I have spring boot application sample with package layout:
main:
-com.foo
Application.java
-com.foo.services
ItemService.java
ItemRepository.java
-com.foo.config
Configuration.java
test:
-com.foo.services
…
I have a retailer class with nested dbref of Address. I would like to fetch retailers based on city which is part of Address class. But I am getting below error.
org.springframework.data.mapping.model.MappingException: Invalid path
reference…
I have a Springboot Reactive Web Rest API with a Mongo Database.
My Method in my UserHandler for adding a user looks like this:
public Mono addUser(Mono user) {
return user
.flatMap(u -> repo.findByEmail(u.getEmail())
…