Category "mongodb"

Access root document map in the $filter aggregation (MongoDb)

I apologize for the vague question description, but I have quite a complex question regarding filtration in MongoDB aggregations. Please, see my data schema to

MongoSQLd not starting on Windows

I'm very new user of Mongo and I'm trying to enable MongoDB connector for BI. I want to change my connect address, but it only connects to 127.0.0.1... I made a

How to delete and insert with a single command in mongoDB?

So, I have a collection like this: [{ "name":String, "address":String, "hobby":Array of Strings }...] Every hour I query an API and get the response l

how to replaceOne document in MongoDb with Mongo database command

We have requirement to execute replaceOne operation with db.runCommand() I checked list of commands from here, but i haven't found any command to replace one do

Storing sessions with express-session, connect-mongo, and mongoose

I am looking for guidance on setting up session based authentication with with Express-Session, connect-mongo, and Mongoose. Currently it's just generating a ne

MongoDB - query references 2 deep of ObjectIDs

I've inherited a Azure Cosmos database with a MongoDB API. There is extensive use of "discriminators" so a single collection has many different models. I am try

Slow query using aggregation framework mongodb

I came up with this code to query a list of questions from db question .aggregate([ { $lookup: { from: "answers", localFie

How to fix " Path is required ,ValidationError " ,Mongoose ,node

I have searched everywhere for this problem. but I cant find the correct way to fix it. help me to what is the problem. const router = require("express").Ro

Specifying a port in MongoDB URI does not allow me to connect to my local DB

I am testing a connection to a local DB using mongoose and mongodb. Whenever I specify a port when passing in the URI to mongoose.connect() I get a connection r

When working with the native mongoDB driver, Node.js and hyper terminal, I receive an error saying "TypeError: Cannot read property 'n' of undefined"

I am using vs-code, hyper-terminal (Git Bash), JavaScript, Node.js, Express, MongoDB and its native driver but while I finished up writing my code, I wrote node

Querying Views with Mongoose (and encapsulating documents fields)

I use mongodb views to encapsulate data in a Data Transfer Object. After the first run of the code below the view is created in the database. Subsequent executi

Querying Views with Mongoose (and encapsulating documents fields)

I use mongodb views to encapsulate data in a Data Transfer Object. After the first run of the code below the view is created in the database. Subsequent executi

What is the difference between mongod and Service of mongodb run in windows services

Recently I started learning Mongodb. After the installation I ran the > mongo command and without starting the daemon ie the mongod and even without starting

Cannot read properties of undefined (reading 'path') - Multer Error

I am uploading an image to a folder in uploads via multer package. I am getting an error while testing the route in POSTMAN. location_model.js const util = requ

How can I call parent function in a child React component?

So I want to add delete button, but when I click it I see error: 'TypeError: props.onDeleteTask is not a function' - in component - SingleTask.js //../component

How to use regex or any other operator with whereIn clause

Is there any way we can use operator or regex as we normally do with the whereIn() clause. I want to use something like this $query->whereIN(name,'like','%te

MongoDB general install question about replica set

I have a server where I have a mongodb database of 150Gb There are 8 databases in it with intensive write activity (as I'm storing tweets) I notice some latency

Error when trying to create dump of mongodb database

i tried to create a dump of a mongodb database on remote server which is running centos,nginx,mongodb v4.0.18 using the following command.. mongodump --host lo

How to filter documents by having a list of words which should not be inside of them in MongoDB Atlas Search?

For example I have the array ["java", "perl", "scrum"] and the following documents: { id: 1, title: "Java Software Developer" }, { id: 2, title: "Senior

DJS Cannot read properties of null (reading 'premium')

In my code, before it does anything I have it check if there is data and if there isnt then make a new mongodb collection but when running the command and there