Category "mongodb"

Cannot install mongo node.js

MONGO HELP I have tried many times to install mongo but I failed. I also checked my network cable but it is working. I am really worried for this kinda problem

MongoDB aggregate for daily won/lost games, $cond is always false

I'm doing a couple of $match's and $unwind's and end up with a collection of documents looking like this: { _id:249776348, StartGameTime:1615789789, team:0, win

How can I download image using GridFSBucket?

I tried everything I found on internet but nothing solved my problem. I really need help on this problem. I'm following the tutorial "How to upload/store images

MongoDB/Mongoose Aggregate Data Duplicates, problem with displaying automatically created ID

I have a Customer DB and I want to aggregate through my data and display all the duplicates on frontend, I'm checking my get request with Insomnia and I get al

mongodb $geowithin for multiple collections

I have a collection with geojson points. I have another collection with geojson multipolygons. How can I run $geowithin against all the boundaries in another co

Can't insert data with mongoDB atlas; Error: queryTxt ETIMEOUT

I've tried to connect to mongodb with node.js, but get the following error. Although I've tried several available solution in this platform, like, changing my D

findOneAndUpdate - document query > 1000

So I have a collection that has over 1million documents clearly, I don't need to search 1000 or more documents as it should only be updating the latest document

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