HTTP/2 302
server: nginx
date: Mon, 28 Jul 2025 12:29:17 GMT
content-type: text/plain; charset=utf-8
content-length: 0
x-archive-redirect-reason: found capture at 20100108121736
location: https://web.archive.org/web/20100108121736/https://github.com/mongodb/mongo-python-driver
server-timing: captures_list;dur=0.961369, exclusion.robots;dur=0.030639, exclusion.robots.policy;dur=0.012500, esindex;dur=0.015944, cdx.remote;dur=251.561245, LoadShardBlock;dur=474.240318, PetaboxLoader3.datanode;dur=79.789046, PetaboxLoader3.resolve;dur=214.262465
x-app-server: wwwb-app221
x-ts: 302
x-tr: 861
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
set-cookie: SERVER=wwwb-app221; path=/
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
HTTP/2 200
server: nginx
date: Mon, 28 Jul 2025 12:29:19 GMT
content-type: text/html; charset=utf-8
x-archive-orig-server: nginx/0.7.61
x-archive-orig-date: Fri, 08 Jan 2010 12:17:35 GMT
x-archive-orig-connection: close
x-archive-orig-status: 200 OK
x-archive-orig-etag: "b873732e372fd1e623852b1470d04aba"
x-archive-orig-x-runtime: 425ms
x-archive-orig-content-length: 35235
x-archive-orig-cache-control: private, max-age=0, must-revalidate
x-archive-guessed-content-type: text/html
x-archive-guessed-charset: utf-8
memento-datetime: Fri, 08 Jan 2010 12:17:36 GMT
link:
; rel="original", ; rel="timemap"; type="application/link-format", ; rel="timegate", ; rel="first memento"; datetime="Wed, 13 May 2009 09:06:05 GMT", ; rel="prev memento"; datetime="Wed, 02 Dec 2009 21:09:47 GMT", ; rel="memento"; datetime="Fri, 08 Jan 2010 12:17:36 GMT", ; rel="next memento"; datetime="Tue, 09 Feb 2010 06:36:01 GMT", ; rel="last memento"; datetime="Thu, 10 Jul 2025 13:43:29 GMT"
content-security-policy: default-src 'self' 'unsafe-eval' 'unsafe-inline' data: blob: archive.org web.archive.org web-static.archive.org wayback-api.archive.org athena.archive.org analytics.archive.org pragma.archivelab.org wwwb-events.archive.org
x-archive-src: 51_13_20100108074535_crawl101-c/51_13_20100108121607_crawl101.arc.gz
server-timing: captures_list;dur=0.677081, exclusion.robots;dur=0.027658, exclusion.robots.policy;dur=0.012780, esindex;dur=0.015518, cdx.remote;dur=1157.788193, LoadShardBlock;dur=180.938009, PetaboxLoader3.datanode;dur=97.809967, PetaboxLoader3.resolve;dur=245.806286, load_resource;dur=203.451108
x-app-server: wwwb-app221
x-ts: 200
x-tr: 1626
server-timing: TR;dur=0,Tw;dur=0,Tc;dur=0
x-location: All
x-rl: 0
x-na: 0
x-page-cache: MISS
server-timing: MISS
x-nid: DigitalOcean
referrer-policy: no-referrer-when-downgrade
permissions-policy: interest-cohort=()
content-encoding: gzip
mongodb's mongo-python-driver at master - GitHub
Tue Jan 05 11:35:53 -0800 2010
README.rst
PyMongo
About
The PyMongo distribution contains tools for interacting with the Mongo database from Python.
The pymongo package is a native Python driver for the Mongo database. The gridfs
package is a gridfs
implementation on top of pymongo .
Installation
If you have setuptools installed you should be able to do easy_install pymongo to install PyMongo. Otherwise you can download the project source and do python setup.py install to install.
Dependencies
The PyMongo distribution has been tested on Python 2.x, where x >= 3. On Python 2.3 the optional
C extension will not be built. This will negatively affect performance, but everything should still work.
Additional dependencies are:
(to generate documentation) sphinx
(to auto-discover tests) nose
Examples
Here's a basic example (for more see the examples/ directory):
>>> import pymongo
>>> connection = pymongo.Connection("localhost", 27017)
>>> db = connection.test
>>> db.name()
u'test'
>>> db.my_collection
Collection(Database(Connection('localhost', 27017), u'test'), u'my_collection')
>>> db.my_collection.save({"x": 10})
ObjectId('4aba15ebe23f6b53b0000000')
>>> db.my_collection.save({"x": 8})
ObjectId('4aba160ee23f6b543e000000')
>>> db.my_collection.save({"x": 11})
ObjectId('4aba160ee23f6b543e000002')
>>> db.my_collection.find_one()
{u'x': 10, u'_id': ObjectId('4aba160ee23f6b543e000002')}
>>> for item in db.my_collection.find():
... print item["x"]
...
10
8
11
>>> db.my_collection.create_index("x")
u'x_1'
>>> for item in db.my_collection.find().sort("x", pymongo.ASCENDING):
... print item["x"]
...
8
10
11
>>> [item["x"] for item in db.my_collection.find().limit(2).skip(1)]
[8, 11]
Documentation
You will need sphinx installed to generate the documentation. Documentation can be generated by running python setup.py doc . Generated documentation can be found in the doc/build/html/ directory.
Testing
The easiest way to run the tests is to install nose (easy_install nose ) and run nosetests or python setup.py test in the root of the distribution. Tests are located in the test/ directory.
This feature is coming soon. Sit tight!