In a sharded cluster with mixed version shards (i.e.
one shard primary is 2.6, another is 2.4 or older) the
result of one call to update could include nModified
when the next does not. Since there is no way to provide
a valid count in this case we omit the field. Make sure
you upgrade your entire cluster to MongoDB 2.6 or newer
before relying on this field.
This change does a few things:
- Raises a new exception for CursorNotFound, inheriting from
OperationFailure so we don't break existing code.
- Catches the exception in cursor.Cursor and command_cursor.CommandCursor,
setting __killed to True.
- If the cursor is not tailable, re-raises the exception. This makes it
easier to deal with capped collection rollover when iterating a
tailable cursor.
This commit adds a helper for the new parallelCollectionScan
command introduced in MongoDB 2.5.5. The helper returns
"num_cursors" instances of CommandCursor that can be iterated
by one or more threads concurrently to scan the entire collection.
This commit also removes the remaining command cursor
hacks from cursor.Cursor.
The cursor returned by aggregate now knows what server
it was created on, allowing it to return getMore results
when the read preference is not PRIMARY.
This also introduces a simplified cursor class for use
with commands that return a cursor id and perhaps an initial
set of results. None of the methods of cursor.Cursor (other
than batch_size) make sense in this case.
Add a 'compile_re' parameter to Collection.find, Collection.find_one, and
json_util.loads. If it's False, regular expressions are encoded as a new class,
Regex, instead of passed to re.compile(). This allows PyMongo to handle regular
expressions that don't compile in Python but are valid in other contexts like
MongoDB queries.