Category "mongodb"

Cant read JSON file imported from MongoDB using pandas

I am trying to read a json file into a pandas dataframe, the import from MongoDB from completed as below client = pymongo.MongoClient("localhost", 27017)

Maps vs Objects vs Arrays for core data structure in React app with document database

My app aims to allow communal viewing+editing of what are essentially tables. It's a react app (with typescript), so being useable as react component state is r

Filter between dates in MongoEngine

I have a problem filtering between date_from and date_to in MongoEngine. This is the document structure and the next MongoEngine query: def devices_graph(device

Mongo updateMany statement with date.withZoneSameInstant(xxx)

I have this collection in my Mongo database: id | place | local time -------------------------- 3 | A | 12pm 4 | A | 11pm 5 | B | 4pm

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