Category "mongodb"

How do I use google cloud storage as a bucket to store user/client images in a MERN Stack app?

I'm working on a pretty vanilla boilerplate blog-style application using mongoDB, express, react and node. It allows for user registration, authentication, for

Is there a way to perform subquery on MongoDB using collection.aggregate() and PHP Driver?

I am migrating a MySQL table which has 50 million+ rows and 40 columns to a MongoDB database. This table data is shown on a html table and every column is searc

Read-only file system when attempting mkdir /data/db on Mac [closed]

I am trying to create a new folder in the main directory Tried all kinds of examples sudo mkdir /data/db sudo mkdir -p /data/db I keep

Rust update mongo document

I'm trying to update my document, if I don't pass a field it is being deleted. my document is { "_id":"27fc47a4-0730-446c-8acd-41aa6e227406", "user_id":"a

MongoDB - Group by inner element

I am explaining with a simple example see my MongoDB collection looks like this: [ { pid: erwer, qty: 3, LevelDetails: {

Too much MongoDB connections when running Node.js mongoose app in Google Cloud Run

I am running a Node.js API connecting to MongoDB Atlas with mongoose. The Node.js API runs on Google Cloud Run. I open one connection using mongoose mongoose.co

MongoDB - Update an Key

I have been trying to update an Object for this collection. Below is the collection. Looking for Server 3.6 version. Here The ask is Need to update the class na

Mongoose - Update an object inside nested array

My Mongo schema looks like this, I want to update a flashcard object located in an array of flashcard also located in an array of subject. const classrooms = ne

MongoDB query to find top store from list of orders

I'm pretty new to Mongo. I have two collections that look as follows. Order collection [ { id: 1, price: 249, store: 1, status: true

How to fix this MongoClient connection?

I'm trying to connect a node.js app (written in TS) to MongoDB at Yandex Cloud. I have successfully connected there via mongosh: mongosh "mongodb://<user>

Can I use GCP Snapshot for data or database backup? can I trust the snapshot to restore my DB data?

I am using the Google cloud platform and compute engine for my project, Installed MongoDB into the instance server, what is the best way to take my database bac

Error: A required parameter (id) was not provided as a string in getStaticPaths for /location/[id] [duplicate]

im working on a next.js and mongodb website and im following this tutorial exactly but with different files/variable names. i keep running int

MongoEngine raw query not solved

Mongo engine cannot execute a raw query AppDocument.objects(__raw__={ {"_id": ObjectId("1"),"car._id": ObjectId("2")}, {"$pull":

How to update value in client site using mongodb?

I am using React in front-end and Node and MongoDB in Back-end. I have created a custom hook from where I am loading the data. The following is the custom hook

MongoDB - Loop through array of arrays

I have a document that contains an array of arrays in my MongoDB collection. { "platformId":"CMC_123", "carInfo":[ ["Toyota",20,"White"],

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|