Category "mongodb"

How do you store a MongoClient connection in a variable for later use?

This is probably a very simple question. I am running into an issue when storing a MongoClient connection in a variable for later use. Using import { MongoClien

When should we use NodeJS and when should we use MongoDB?

As a new developer, I am always confused about using NodeJS and MongoDB. So I hope I will get an actual answer. Thanks...

I create some document to mongoose but not showing

I tried to create 5 documents in mondoDB , and I’m sure that I successfully created 5 documents. But it only shows one document on Robo3T. Here is my code

After jwt verification the state change is not presisting

So on the front end I'm using this function to have the user Log In if they have a This Function only works at the time of log in and after if the users just na

Cannot read property 'substring' of undefined in ejs

When I try to add new blog posts to my website I am continuously getting this error: TypeError: C:\Users\shruti\Desktop\ejs-challenge\views\home.ejs:15 13| 14|

Mongoimport and mongorestore does not work on Atlas free tier

I want to migrate from Azure Cosmos Db to Mongo Db Atlas (on Azure), so I am testing in a subscription with a free tier. I exported a collection from Cosmos wit

k8s pod failed to connect mongodb

I'm trying to do a k8s tutorial on youtube https://www.youtube.com/watch?v=X48VuDVv0do&t=5428s. An error occured that k8s pod failed to connect mongodb when

Heroku logs : Service temporarily unavailable. Please try again later

FIRST : When I run in my terminal : heroku logs or heroku logs --tail, I get "Service temporarily unavailable. Please try again later" What does it mean pleas

Creating mongoDB alias with .bash_profile on the cmder is not working

this is my first ever question. Okay.. Relevant to this problem : I am using cmder I am new to the terminal I am using a windows PC I'm following a tutorial on

Mongoose calculating average from another collection

I am new to MongoDB/Mongoose. I am trying to do a search based on a key string for a 'Resource' which will return a list of resources based on average of rating

how to install MongoDb on Debian 11

I followed the description of how to install MongoDB to Debian 11 that can be found in severall places. Since all describe the same, I selected one of them. Eve

Mongoose - find object and delete objeto inside array

I have this document : [ { "_id": "626c5fd2aa0fc0e4eef45c94", "productos": [ { "_id": "626d50b621180e291a330333"

is there any way to store data in sqflite and when data connection is available upload the data to online mongodb server

Hey friends I want to know a way in which I can store the app data in offline mode and when the data connection is available then the app sync the data to my on

MongoDB Compass Export Pipeline to Language with other style

In MongoDB Compass, when I choose to export the Aggregation Pipeline to Java, I get something like this: Arrays.asList(new Document("$group", new Document(

What should the response status code be in a REST API when the given ID is a valid ID but there's no matching document?

I'm using MongoDB for my Express app and I know that when an ID is an invalid ID for the corresponding database, the response status code is 400 (Bad Request).

Document Read and insert with locking/transaction in nodejs with mongodb

In reservation system, only 5 different user can create bookings. If 100 user call booking api at same time than how to handle concurrency with locking. I am us

Querying with mongoose: how to parce a Mongo _id?

I found this similar question to mine, but without explanation Mongoose find query vs $match, I'm trying to do something similar. I manage to filter by today's

Mongoose - array of enum strings

I have a Schema that has a property with the type of array of strings that are predefined. This is what I've tried to do: interests: { type: [String], e

Achieve "all-or-nothing" transaction between Oracle and MongoDB

I have an usecase(migrate data from Oracle to MongoDB via Java app) where I required to implement transaction management to ensure "all-or-nothing" in the datas

Update a local python dictionary using mongo syntax, without mongo

I have a codebase that uses mongo. I want to add a caching layer in between where the persistence code is called and the actual mongo db, primarily so that I ca