Category "mongodb"

Efficiently upsert thousands of records to mongodb

We have a database containing around ~20 Million records with an indexed field order_id. Every day, after each hour, we receive an incremental update, starting

Script that returns _id in MongoDB with JavaScript

I need a javascript code that saves in a variable the _id I'm having trouble getting that _id because it’s inside an array. I have looked everywhere but I

MongoDB - Better to split collection into multiple collections?

I have a collection Sensors. Sensors contains sensor data from different sensors from different location IDs. I will be running some analytics on this sensor da

$concat for one field in mongosh updateOne method

I want to update a particular document for the email field based on its id, but I don't want to overwrite the email field completely. Instead, I just want to ad

Mongo DB Update data

I want to decrease previours quantity by 1 how can I do this in Node Js Mongo Db Here is my code: app.put('/quantityUpdate',async(req,res)=>{

Pymongo: update document only if value of a field matches a provided value

Is it possible to update a document based on the condition that the value of a field in that document matches a value that I provide? I can easily do this in tw

Pymongo: update document only if value of a field matches a provided value

Is it possible to update a document based on the condition that the value of a field in that document matches a value that I provide? I can easily do this in tw

How to read and write BSON files with Spark?

I have many MongoDB dumps in gzip compressed BSON files, each with multiple documents. I would like to read them directly to Spark, ideally partitioning on indi

Many to many relation table field into MongoDB

While doing a many to many relationship in SQL we create a table that will have the ID of the 2 tables that are forming the relationship. Sometimes in that tabl

MongoDB Projecting specific values from objects in nested arrays according to filtering rules

I am quite new to MongoDB, using it first time on a large scale app. We have a complicated nested structure representing an object with multiple documents assoc

TypeError: Cannot assign to read only property 'message' of object 'SyntaxError: unknown: Missing semicolon. (1:12)

I am New to Mongo and Started Learning from Mango Basics. i am following the course and when I tried to write the Mongodump it is giving "SyntaxError: Missing s

express-session unable to retrieve session variable

I am using express-session to store my sessions persistently on a MongoDB database. The project worked perfectly in a development environment but for some reaso

Best way to structure deep time-series data in MongoDB?

I'm migrated from MySQL to MongoDB and looking to optimize the storage of my time-series data. Each item in my database has an array of values for multiple loca

Why does My chrome Browser show the issue "Audit usage of navigator.userAgent, navigator.appVersion, and navigator.platform"?

My chrome browser suddenly shows an issue like that A page or script is accessing at least one of the navigators.UserAgent, navigator.appVersion, and navigator.

Setting up a SSL certificate for a MongoDB server that prevents connections from MongoDBCompass and the NodeJS application

I want to add a SSL certificate to my MongoDB server to have an extra level of security. But with the SSL certificate, it is impossible to connect with "MongoDB

I'm looking to get completed events counts but this query not working

My query let findEvents = await eventModel.aggregate([ { $match: { participants: { $eq: event.userId }, eventStatus: { $

MongoDB Replicaset - How to solve "Could not find self in current config" on Secondary node

I am running a MongoDB server running V4.4.14 installed on VMs configured as follows: 1 Primary 2 Secondary 1 Arbiter Nodes are not on the same local network an

In my MongoDB project i'm facing this problem: "DELETE http://localhost:5000/user/undefined 404 (Not Found)"

I am calling a DELETE request using fetch. But The request is not working. How can i solve this? Please help me!.

Set mongoose schema with changing fields

I want to make a mongoose schema that will append timeseries data. I got the idea for that model after reading this (https://www.mongodb.com/blog/post/schema-de

Which relation in MongoDB is better?

For my whole projects I have relationed my multiple collection as this. User model Name:string, email:string, password:string, vehicles:[{ "vehicleId", "vehi