Commit Graph

29 Commits

Author SHA1 Message Date
Bernie Hackett
80aa1117fd PYTHON-1071 - Use command reported namespace for getMore 2016-03-14 13:47:45 -07:00
aherlihy
b8528100e1 PYTHON-978 - Use getMore command for CommandCursor 2015-11-18 14:12:28 -08:00
aherlihy
1a3aeea426 PYTHON-978 - Use find/getMore commands 2015-11-18 12:57:47 -08:00
Bernie Hackett
28885b25e8 PYTHON-952 - API improvements
This commit implements the following simplifications and improvements:

- The Subscriber ABC has been renamed to CommandListener
- The subscribe function has been renamed to register
- The COMMAND constant has been removed
- The get_subscribers function has been removed
- Command listeners can now be registered per MongoClient instance
  instead of just globally
2015-10-09 17:03:51 -07:00
Luke Lovett
b6182d0587 PYTHON-976 - Publish a CommandFailedEvent for arbitrary failures. 2015-10-07 11:08:05 -07:00
Bernie Hackett
5dba74c005 PYTHON-952 - killCursors monitoring 2015-08-17 16:22:19 -07:00
Bernie Hackett
07d2199477 PYTHON-952 - Fix duration measurements.
We weren't including the time to decode responses in
a number of places. This commit also fixes an issue with
handling "cursor not found" errors from mongos versions
older than 2.4.
2015-08-12 14:04:21 -07:00
Bernie Hackett
fa4a6a39d3 PYTHON-952 - Query and getMore monitoring
This commit adds support for monitoring queries and getMore
operations, including getMore operations for command cursors
(e.g. aggregate cursor getMore). It also fixes a bug in duration
calculation.
2015-08-11 12:19:28 -07:00
aherlihy
66dbe93d45 PYTHON-945 - Remove validation of the OP_REPLY "startingFrom" field. 2015-06-08 16:24:13 -07:00
Bernie Hackett
58ab8df727 PYTHON-894 - More doc clarifications for alive. 2015-05-07 14:52:31 -07:00
A. Jesse Jiryu Davis
cb64f87aa6 PYTHON-894 - Set cursor.alive False after final batch.
Even with this change, "next" can raise StopIteration even though
"alive" is True. For example if batch size is 2 and there are 4
documents in the result set, then after the 4th document "alive" is True
but "next" raises StopIteration.
2015-04-17 14:56:36 -04:00
Bernie Hackett
1a8478dbd5 PYTHON-893 - Fix application of SON manipulators in CommandCursor. 2015-04-14 11:39:23 -07:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
Bernie Hackett
b71526a2da PYTHON-836 - Always set slaveOk bit for non-mongos direct connection. 2015-03-07 11:09:16 -08:00
Bernie Hackett
3f3b6bedfc PYTHON-846 - Database.connection -> Database.client 2015-02-25 11:57:39 -08:00
Bernie Hackett
1db2b0bfa5 PYTHON-800 - Clean up internal use of CodecOptions. 2014-12-23 19:52:31 -08:00
Bernie Hackett
fe5e723285 PYTHON-806 - Always use command cursor 'ns' value for OP_GET_MORE 2014-12-18 16:12:38 -08:00
A. Jesse Jiryu Davis
2ba730722b PYTHON-526 Remove 'compile_re' option.
PyMongo now never attempts to compile BSON regular expressions as Python native
regular expressions.
2014-12-05 14:06:38 -05:00
A. Jesse Jiryu Davis
daad4446f8 Rename connection_id and conn_id to "address". 2014-11-18 17:40:34 -05:00
A. Jesse Jiryu Davis
735a1247ca PYTHON-525 Deprecate MongoReplicaSetClient.
MongoClient now supports all MongoReplicaSetClient's features.
Fix bugs and add features in the new MongoClient to bring it up
to spec. MongoReplicaSetClient is now a deprecated stub that
subclasses MongoClient.

Introduce new errors, NetworkTimeout and NotMasterError, to
communicate events that MongoClient must handle specially.
2014-09-16 15:33:19 -04:00
A. Jesse Jiryu Davis
2f9d24ade6 PYTHON-525 Reimplement MongoClient to use Cluster.
Replace MongoClient with an implementation that relies on Cluster and Server. The new MongoClient takes over MongoReplicaSetClient's responsibilities.

Authentication, secondary-pinning, and Mongos high-availability are broken and will be reimplemented in a future commit. RS tests are temporarily disabled.
2014-08-28 16:57:57 -04:00
A. Jesse Jiryu Davis
d3326de5aa close_cursors requires 'address' parameter. 2014-07-28 21:21:37 -04:00
A. Jesse Jiryu Davis
36c3ccb007 Wrap server responses in a Response or ExhaustResponse object. 2014-07-28 21:21:37 -04:00
Luke Lovett
d494105aa4 PYTHON-674 python 2/3 single-source for the pymongo module 2014-04-23 18:26:18 +00:00
A. Jesse Jiryu Davis
36c13e597e Expose some CommandCursor state. 2014-02-13 16:22:12 -05:00
Bernie Hackett
a217d30e72 Changes to make cursor testing easier. 2014-02-12 18:11:16 -08:00
Bernie Hackett
e3c809bd02 Gracefully kill cursor on capped rollover PYTHON-637
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.
2014-02-12 08:33:13 -08:00
Bernie Hackett
940d73f672 Add parallel_collection_scan helper PYTHON-633
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.
2014-02-11 13:04:53 -08:00
Bernie Hackett
cdacc2f4b9 Fix aggregate cursor read preference issues PYTHON-636
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.
2014-02-10 18:55:50 -08:00