PyMongo
PyMongo
#pymongo
Table of Contents
About
1
Chapter 1: Getting started with PyMongo
2
Remarks
2
Examples
2
Installation or Setup
2
Hello, World
2
Install PyMongo
2
Create a connection
3
Access Database Objects
3
Access Collection Objects
3
Basic CRUD Operation
3
Create
3
Update
4
Read
4
Query With Projection
Delete
Chapter 2: Converting between BSON and JSON
4
4
6
Introduction
6
Examples
6
Using json_util
6
Simple usage
6
JSONOptions
6
Using python-bsonjs
7
Installation
8
Usage
8
Using the json module with custom handlers
Chapter 3: Filter documents by creation time stored in ObjectId
8
10
Introduction
10
Examples
10
Documents created in the last 60 seconds
10
Credits
11
About
You can share this PDF with anyone you feel could benefit from it, downloaded the latest version
from: pymongo
It is an unofficial and free PyMongo ebook created for educational purposes. All the content is
extracted from Stack Overflow Documentation, which is written by many hardworking individuals at
Stack Overflow. It is neither affiliated with Stack Overflow nor official PyMongo.
The content is released under Creative Commons BY-SA, and the list of contributors to each
chapter are provided in the credits section at the end of this book. Images may be copyright of
their respective owners unless otherwise specified. All trademarks and registered trademarks are
the property of their respective company owners.
Use the content presented in this book at your own risk; it is not guaranteed to be correct nor
accurate, please send your feedback and corrections to info@
1
Chapter 1: Getting started with PyMongo
Remarks
This section provides an overview of what pymongo is, and why a developer might want to use it.
It should also mention any large subjects within pymongo, and link out to the related topics. Since
the Documentation for pymongo is new, you may need to create initial versions of those related
topics.
Examples
Installation or Setup
Detailed instructions on getting pymongo set up or installed.
? Installing with Pip
¡ð
To install pymongo for the first time:
pip install pymongo
¡ð
Installing a specific version of pymongo:
Where X.X.X is the version to be installed
pip install pymongo==X.X.X
¡ð
Upgrading existing pymongo:
pip install --upgrade pymongo
? Installing with easy_install
¡ð
To install pymongo for the first time:
python -m easy_install pymongo
¡ð
Upgrading existing pymongo:
python -m easy_install -U pymongo
Hello, World
PyMongo is a native Python driver for MongoDB.
Install PyMongo
2
................
................
In order to avoid copyright disputes, this page is only a partial summary.
To fulfill the demand for quickly locating and searching documents.
It is intelligent file search solution for home and business.