Category "mongodb"

Heroku and MongoDB Atlas - 5000ms Response time??? (MERN stack)

Have recently built a MERN stack application. For whatever reason I can't figure out, I'm getting a 5000ms response time and can't for the life of me figure out

group in mongo excluding null values

I have mongo query which does the group operation on the documents. I have almost got the expected results except that I want to refine the results without emp

Check whether the document exists using Mongodb and Java?

I have created a simple java application as my college mini project in which one of the module I'm allowing users to perform operations like insert, delete, upd

MongoDB "Writing to log file failed, aborting application"

After save about 80G data, mongodb just crash. journalctl -u mongod shows the error message below mongod[4948]: {"t":{"$date":"2022-03-31T10:38:44.089+00:00"},"

Add key value pair data

I have a schema in Mongoose that looks like this: const SocketDetailsUserSchema = new mongoose.Schema({ userId: String, socketValue: [{ id: St

MongoError: connect ECONNREFUSED 127.0.0.1:27017

I'm using NodeJS wih MongoDB using mongodb package. When I run mongod command it works fine and gives "waiting for connection on port 27017". So, mongod seems t

Mongodb: mongodump collections that their names contain a path separator '/'

I have a database with a lot of collections that have '/' in their names. The problem is mongodump will fail in this circumstance. Failed: "CollectionNameWith/

How do I seed a mongo database using docker-compose?

I am trying to distribute a set of connected applications running in several linked containers that includes a mongo database that is required to: be distribut

MongoDB $or query

I run following query in mongo shell: db.Profiles.find ( { $or : [ { "name" : "gary" }, {"name":"rob} ] } ) It just returns nothing as expected(JSON)?

Multiple endpoints Graphql

Im working on a project that displays a list of .xml and .txt files on a web browser. Using a MERN Graphql stack, is it possible to have two different endpoints

MongoDb authentication failing on accessing database while using docker?

I have been trying to setup password to mongodb My docker-compose file is version: "3" services: mongo: image: mongo ports: -

Performance penalty when using fluent interface

I am an absolute beginner when it comes to MongoDb. Just joined a new project where it is used, so I tried to do few experiments to get myself familiar. I got t

Cascade style delete in Mongoose

Is there a way to delete all children of an parent in Mongoose, similar to using MySQLs foreign keys? For example, in MySQL I'd assign a foreign key and set it

Memory leak with Mongo Java Connection

I am constructing MongoClient Connection in the below manner : public static synchronized MongoClient getInstance(String mongoDbUri) { try {

Mongodb - Mongoimport error invalid character

I tried to import a simple json file using mongoimport and i get the following error PER-MacBook-Pro:/AJ$ mongoimport --db test --collection samplePM --file /

MongoDB - Error: document must have an _id before saving

I've been struggling so much with this project. I am following a tutorial that is out of date in some areas, for instance their version of Jquery used a totally

Mongoose: Get full list of users

I have tried to use Mongoose to send the list of all users as follows: server.get('/usersList', function(req, res) { var users = {}; User.find({}, fun

Getting error while running the aggregate method of MognoDB

I am getting the following error while joining two collection and project the fields using MognoDB. Error:: Error: command failed: { "ok" : 0, "er

How to read a specific key-value pair from mongodb collection

If I have a mongodb collection users like this: { "_id": 1, "name": { "first" : "John", "last" :"Backus" }, } How do I retrieve name.first from

mongodb set field value using if else during document update

Is there a way in mongodb to use if/else to set a field value during an update. i know that i can use find, to return documents, loop over them, and do if/else