Pymongo
pip install pymongo
Python package to manage interaction with mongoldb
Three levels: client, db, and collection
Connecting to Mongo Atlas
To make up for their shitty documentation, their stupid mongodb+srv://
... requires pymongo 3.5+ and openssl version
must return 1.1 or more. And you must use the following extra code
QUERYING
Returns a cursor which is iterable, use .count to get the number in the cursor for empty checking
Inserting
post is a dict
"_id", is automatically added if the document doesn’t already contain an "_id" key
use insert_many to insert list of dicts
-
DELETING
Last updated