PYTHON-963 - A few more doctest fixes.
This commit is contained in:
parent
d312f8787d
commit
89b7a9d5af
@ -116,7 +116,7 @@ the failure.
|
||||
'upserted': [],
|
||||
'writeConcernErrors': [],
|
||||
'writeErrors': [{u'code': 11000,
|
||||
u'errmsg': u'...E11000 duplicate key error index: bulk_example.test.$_id_ dup key: { : 4 }',
|
||||
u'errmsg': u'...E11000 duplicate key error...',
|
||||
u'index': 1,
|
||||
u'op': {'_id': 4}}]}
|
||||
|
||||
@ -153,11 +153,11 @@ and fourth operations succeed.
|
||||
'upserted': [],
|
||||
'writeConcernErrors': [],
|
||||
'writeErrors': [{u'code': 11000,
|
||||
u'errmsg': u'...E11000 duplicate key error index: bulk_example.test.$_id_ dup key: { : 1 }',
|
||||
u'errmsg': u'...E11000 duplicate key error...',
|
||||
u'index': 0,
|
||||
u'op': {'_id': 1}},
|
||||
{u'code': 11000,
|
||||
u'errmsg': u'...E11000 duplicate key error index: bulk_example.test.$_id_ dup key: { : 3 }',
|
||||
u'errmsg': u'...E11000 duplicate key error...',
|
||||
u'index': 2,
|
||||
u'op': {'_id': 3}}]}
|
||||
|
||||
|
||||
@ -144,8 +144,8 @@ of the collections in our database:
|
||||
|
||||
.. doctest::
|
||||
|
||||
>>> db.collection_names()
|
||||
[u'posts', u'system.indexes']
|
||||
>>> db.collection_names(include_system_collections=False)
|
||||
[u'posts']
|
||||
|
||||
.. note:: The *system.indexes* collection is a special internal
|
||||
collection that was created automatically.
|
||||
@ -355,9 +355,8 @@ First, we'll need to create the index:
|
||||
|
||||
>>> result = db.profiles.create_index([('user_id', pymongo.ASCENDING)],
|
||||
... unique=True)
|
||||
>>> [idx['name']
|
||||
... for idx in db.system.indexes.find({'ns': 'test-database.profiles'})]
|
||||
[u'_id_', u'user_id_1']
|
||||
>>> list(db.profiles.index_information())
|
||||
[u'user_id_1', u'_id_']
|
||||
|
||||
Notice that we have two indexes now: one is the index on ``_id`` that MongoDB
|
||||
creates automatically, and the other is the index on ``user_id`` we just
|
||||
|
||||
Loading…
Reference in New Issue
Block a user