Top "Mongodb-query" questions

This tag is for questions related to querying and updating MongoDB collections, either through the mongo shell or using a programming language driver.

Pymongo: bson.errors.InvalidDocument: Cannot encode object: <pymongo.cursor.Cursor object at 0xc61990>

I am trying to insert a dictionary using Pymongo into a MongoDB collection. The code segment is newdict = {'id': a, …

python mongodb mongodb-query pymongo twython
mongodb impossible (?) E11000 duplicate key error dup key when upserting

My understanding is that update with upsert:true on a single document is an atomic operation so this should never …

mongodb mongodb-query wiredtiger
MongoDB Find performance: single compound index VS two single field indexes

I'm looking for an advice about which indexing strategy to use in MongoDb 3.4. Let's suppose we have a people collection …

mongodb performance indexing mongodb-query
MongoDB: Find an object by its ID without knowing the collection

I have an mongodb databse with 100+ collections. I'm trying to find an object, with a known ObjectID, that belongs to …

mongodb mongodb-query robo3t
MongoDB "NumberLong/$numberLong" issue while converting back to Java Object

I am having a json which is somethink like {"Header" : {"name" : "TestData", "contactNumber" : 8019071740}} If i insert this to mongoDB it …

java json mongodb mongodb-query bson
Getting unix timestamp in seconds out of MongoDB ISODate during aggregation

I was searching for this one but I couldn't find anything useful to solve my case. What I want is …

mongodb mongodb-query aggregation-framework unix-timestamp isodate
How to restore gzipped Monogdb single collection?

Hye everyone, I am new to mongodb I dumped one of my collection using following command mongodump --db somedb --collection …

mongodb mongodb-query mongodump mongorestore database
Query Embedded Document List in MongoEngine

I need query a list with all embedded documents in mongoengine. Here is my schema: class Variant(EmbeddedDocument): name = StringField(…

python mongodb mongodb-query mongoengine
how to get data in batches in mongodb

I want to retrieve data from MongoDB, 5 at a time I am using limit to limit the number of records …

mongodb mongodb-query monk
Convert ObjectID to String in mongo Aggregation

I'm in this scenario right now: I have a collection X: { _id:ObjectId('56edbb4d5f084a51131dd4c6…

mongodb mongoose mongodb-query aggregation-framework robo3t