How to custom sort only specific results in Spring MongoDB?

Is it possible to sort only results that matches a condition in Spring Mongo? Let us say I have this data: Color Fruit Amount Orange Orange 23 Red Apple 4 Red Strawberry 66 Yellow Banana 2 I …

MongoTimeoutException: No Server Match – MongoDB Atlas

For a few days now, I can’t connect to any of my MongoDB Databases that are hosted by Altas. I’m always getting a MongoTimeoutException Exception in thread “Thread-9” com.mongodb….

package com.mongodb.client does not exist for a java console program

So here is the back story … I need to make a simple java console project that accesses a MongoDB database and makes some changes to the records within so that another (much larger) program doesn’t …

Can’t modify @Embedded List in Morphia

I have the following Entity: @Entity(“users”) public class UserModel { @Id private ObjectId id; private String userID; private String prefix; private List …

Is it possible to use MongoDb and PostgreSql for same model in Spring boot?

I have built a User management service in which I’m using MongoDb (spring data). I have two models User and Role. package com.userservice.usermanagement.models; import java.util.HashSet; import java….

How to count array elements properly with multiple aggregation in Spring Data MongoDB?

I need to create advanced aggregation using Spring Data MongoDB having model like that: @Getter @Setter @Document public class City { @Id @JsonSerialize(using = ToStringSerializer.class) …

How to get list of data containing count of a field using Aggregation and Criteria in Spring Boot with MangoDB

Requirement: documents-bookdata collection may have multiple objects with same bookPublisherName but different bookName. Means multiple books can have same publisher so need to extract count of books …

nodejs mongodb and android studio slow fetch speed

I have a system which, pulls data from my server and stores it to a mobile SQL database via android studio. It works but it is painful slow like 30mins. I have around 86000 records in my database and …

Mongo aggregate sum of two Strings

I am trying to sum one field in Mongo. If it is an Integer there is no issue, but the problem is that it is String and I get 0 for totalAmount private Integer findRequestAmount(String agentId, String …

Connecting to mongoDB in spring boot causes errors

I want to connect to mongoDB Atlas in a spring boot project, but always Exceptions are thrown. If I use Java without spring boot, everything works fine. The following test project reproduces the …