Top "Pymongo" questions

PyMongo is the official Python driver for MongoDB created and maintained by MongoDB, Inc.

Using .sort with PyMongo

With PyMongo, when I try to retrieve objects sorted by their 'number' and 'date' fields like this: db.test.find({"…

python mongodb pymongo
Mongodb bulk write error

I'm executing bulk write bulk = new_packets.initialize_ordered_bulk_op() bulk.insert(packet) output = bulk.execute() and getting an …

mongodb pymongo
pymongo auth failed in python script

I have installed mongodb and enabled auth. and its working find. I can connect it from remote notebook using robomongo …

python mongodb pymongo
How to check if a pymongo cursor has query results

I need to check if a find statement returns a non-empty query. What I was doing was the following: query = …

python mongodb pymongo mongodb-query
pymongo- How can I have distinct values for a field along with other query parameters

I am using pymongo and want to have distinct values for a field such that I can also pass other …

python mongodb pymongo
Pymongo / MongoDB: create index or ensure index?

I don't understand the difference between create_index and ensure_index in pymongo. On the MongoDB indexes page, it says …

python mongodb pymongo
import error: no module named bson

I'm trying to import json_util in my environment file: from bson import json_util I get this import error: …

python pymongo bson
pymongo - mongodb+srv "dnspython must be installed" error

I am trying to connect MongoDB from Atlas But I encountered: dnspython must be installed error My mongo uri (mockup): …

python database mongodb pymongo dnspython
how to issue a "show dbs" from pymongo

I'm using pymongo and I can't figure out how to execute the mongodb interactive shell equivalent of "show dbs".

python mongodb pymongo
How to limit mongo query in python

I am trying to retrieve data from mongodb with python. My db contains lots of data. So I want to …

python mongodb pymongo