~crunch.io/ubuntu/precise/pymongo/unstable

« back to all changes in this revision

Viewing changes to README.rst

  • Committer: Joseph Tate
  • Date: 2013-01-31 08:00:57 UTC
  • mfrom: (1.1.12)
  • Revision ID: jtate@dragonstrider.com-20130131080057-y7lv17xi6x8c1j5x
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
 
41
41
The PyMongo distribution is supported and tested on Python 2.x (where
42
42
x >= 4) and Python 3.x (where x >= 1). PyMongo versions <= 1.3 also
43
 
supported Python 2.3, but that is no longer supported. If you need to
44
 
use Python 2.3 please contact us.
 
43
supported Python 2.3, but that is no longer supported.
45
44
 
46
45
Additional dependencies are:
47
46
 
53
52
Here's a basic example (for more see the *examples* section of the docs):
54
53
 
55
54
>>> import pymongo
56
 
>>> connection = pymongo.Connection("localhost", 27017)
 
55
>>> connection = pymongo.MongoClient("localhost", 27017)
57
56
>>> db = connection.test
58
57
>>> db.name
59
58
u'test'
60
59
>>> db.my_collection
61
 
Collection(Database(Connection('localhost', 27017), u'test'), u'my_collection')
 
60
Collection(Database(MongoClient('localhost', 27017), u'test'), u'my_collection')
62
61
>>> db.my_collection.save({"x": 10})
63
62
ObjectId('4aba15ebe23f6b53b0000000')
64
63
>>> db.my_collection.save({"x": 8})