Category "pymongo"

Unable to return json values retrieved from MongoDB to HTML page in python flask

I'm able to retrieve required value from MongoDB individually and also able to print same values but unable to return all those values to HTML page. When I try

pymongo - "dnspython" module must be installed to use mongodb+srv:// URIs

I am trying to connect MongoDB from Atlas. My mongo uri is: mongodb+srv://abc:[email protected]/admin?retryWrites=True My pymongo version is 3.6.1 I h

Searching using japanese string in documentdb

I'm trying to search in a collection containing firstname and lastname in japanese characters. Somehow there is no result returned even when there is data in th

How to deal with unknown types of functions/methods from imported modules

I'm wondering what's the best approach to deal with unknown types of functions/methods associated with other modules. Note that I'm using strict mode For exampl

How to parse the collections in `mongodump` archive output using Python?

Context I have a MongoDB that is backed up every day using the following command mongodump --gzip --numParallelCollections=1 --oplog --archive=/tmp/dump.gz --re

Mongoengine raw find_and_modify query gives "Must either update or remove" exception

I am using Django + mongoengine I want to update the books (embedded document) count in my Bookscollection document. I want the update query to return the full

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