Category "pymongo"

How to convert a pymongo.cursor.Cursor into a dict?

I am using pymongo to query for all items in a region (actually it is to query for all venues in a region on a map). I used db.command(SON()) before to search i

connection times out when trying to connect to mongodb atlas with python

I'm trying to connect to my mongodb atlas cluster but i keep getting timed out as soon as i try to do something with my db. The db i use was created in mongos

MongoDB: Find the minimum element in array and delete it

I have a documents in MongoDB, one of them looks like this: { "_id" : 100, "name" : "Something", "items" : [ { "item" : 47, "color" : "red"

MongoDB: multiple $elemMatch

I have MongoDB documents structured like this: {_id: ObjectId("53d760721423030c7e14266f"), fruit: 'apple', vitamins: [ { _id: 1, name: 'B7',

Listing users for certain DB with PyMongo

What I'm trying to acheive I'm trying to fetch users for a certain database. What I did so far I was able to find function to list the databases or create us

How can I type annotate a PyMongo Collection?

I'm currently using: from typing import Type from pymongo.collection import Collection def collection_type_test(example_collection: Type[Collection]) -> lis

Insert a document with Flask-PyMongo

I have a MongoDB database and I want to use Flask-PyMongo to work with it in my Flask app. How do I add a database and a collection so I can add user documents