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 seg-fault when it tries to read from them. Now I’m trying to get my java console project to connect to the MongoDB, but the
Tag: mongodb
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 …
Connection refused trying to connect to mongoDB docker instance
I’m trying to deploy a simple app with a MongoDB with JPA, but I can’t make it work right. When I deploy the app in a docker container, I keep getting the following error: This is the dockerfile I use to build the image: And the docker-compose.yml I used to run mongoDB: My entities all follow the following pattern (being
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. Role model – and Role enumerator- In User there is a role attribute which I have @Dbref to role collection. My problem is that I want to have a option of using PostgreSql and MongoDb in the same application
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: pom.xml Cities collection: Libraries collection: Books collection: Depending on the context of the user, I have to return cities with count of libraries and books in the city that can be filtered based on startsWith() or like() principle. Assuming that I have 2 libraries in one
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 per publisher . Model class: Response format pojo Response Format Answer This requirement can also be done logically ..like get the list of DocumentsBookdata using findAll and than filter it using loop and
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 want to pull all of them out of the server. What is the best way to do this? Presently I get
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 amountField is a String, how can I sum it in this implementation Answer You are getting String amountField. Simply you can convert this String to Integer by using
Spring boot / Java, mongodb SSL / TLS connectivity
I have two projects where I use spring boot + mongodb. In one project the spring boot version is 1.4.1.RELEASE and other project is 2.1.3.RELEASE. I have certificate(s), key in PEM format to onboard into truststore and keystore – One server certificate chain and other a client certificate and private key. I programmatically load the certificates into truststore and keystore.
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 errors. The pom.xml: The Main-class: And the configuration for mongoDB: The uri for mongoDB is stored in application.properties. If I start the server, the following exeception is