Commit Graph

114 Commits

Author SHA1 Message Date
Tony Narlock
22f83c5a55 Remove unused import (#379) 2018-10-25 10:44:38 -07:00
Shane Harvey
3b9e99015f PYTHON-1508 Only send readConcern on first command in a transaction 2018-06-24 11:39:23 -04:00
Shane Harvey
05c7c65470 PYTHON-1329 OP_MSG with unacknowledged writes
Replace OP_INSERT/OP_UPDATE/OP_DELETE usage with OP_MSG with moreToCome
flag when the server is 3.6 or greater.
Unack'ed OP_MSG supports bypass_document_validation.
getLastError updatedExisting is always false on mongos after an OP_MSG
unack'ed update.
2018-06-23 11:46:50 -04:00
Bernie Hackett
4a9c65eb22 PYTHON-1329 - OP_MSG unacknowledged bulk writes 2018-06-22 22:00:07 -07:00
Bernie Hackett
f8883dfb1f PYTHON-1329 - Fix C extensions use for compression 2018-06-21 17:30:15 -07:00
Bernie Hackett
4d786fd0cd PYTHON-1329 - OP_MSG bulk writes 2018-06-21 16:03:20 -07:00
Shane Harvey
ea8cb6c209 PYTHON-1329 Send/receive commands as OP_MSG
Don't use $query with OP_MSG.
Support compression with OP_MSG.
2018-06-21 15:46:48 -07:00
Shane Harvey
6810b454d4 Don't use private slot names on class names with leading underscores 2018-06-05 10:05:39 -07:00
Bernie Hackett
335cb97a34 PYTHON-1278, PYTHON-1553 - Support OP_COMPRESSED 2018-05-22 11:44:21 -07:00
Shane Harvey
04693ae33a PYTHON-1513 Efficiently read data using memoryview and recv_into
On Python 2, preallocate a bytearray and use slice assignment instead of
using str +=.
On Python 3, preallocate a bytearray and use a memoryview with recv_into.
2018-05-08 11:28:12 -07:00
Shane Harvey
09891a4ff3 Bring autoStartTransaction up to spec 2018-04-16 09:57:45 -04:00
Shane Harvey
cd92850b36 Test changing transaction readPreference
Add original readPreference to getMores to simplify code check.
2018-04-16 09:57:45 -04:00
A. Jesse Jiryu Davis
c305f14e18 cache Query/GetMore.as_command, send stmtId with commit/abortTransaction
fix comparison of insertedIds in test_transactions.py
2018-04-16 09:57:45 -04:00
A. Jesse Jiryu Davis
9df87b6401 prototype transaction tests 2018-04-16 09:57:45 -04:00
A. Jesse Jiryu Davis
37778bac3e PYTHON-1479 - Don't add projection to "find" cmd twice, 2 2018-02-21 17:59:06 -05:00
A. Jesse Jiryu Davis
2ad6117af2 PYTHON-1479 - Don't add projection to "find" cmd twice 2018-02-16 09:46:47 -05:00
Bernie Hackett
507f954ed4 Update copyright dates 2017-12-01 17:23:39 -08:00
Shane Harvey
2a05236f61 PYTHON-1332 Only gossip cluster time on >= 3.6.
Do not add readConcern to explain.
Test explain with collation.
2017-11-30 14:53:14 -08:00
Shane Harvey
b669cd86dc PYTHON-1332 Session may only be used by the client that started it.
Centralize $clusterTime receiving.
2017-11-17 09:27:21 -08:00
Bernie Hackett
4eda4ffaec PYTHON-1340 - Implement causally consistent reads 2017-11-09 17:16:55 -08:00
Bernie Hackett
036188a832 PYTHON-1385 - Publish command responses in _first_batch 2017-11-09 10:24:18 -08:00
Shane Harvey
280efd2d72 PYTHON-1339 Generate a single message in _do_batched_write_command.
Ordered op_insert should check for errors on the last insert.
Use _Bulk API for Collection.insert.
Avoid sending acknowledged inserts as much as possible.
max_cmd_size already accounts for trailing null bytes.
2017-10-31 16:59:26 -04:00
Shane Harvey
6721e0157b Revert "PYTHON-1299 Remove "safe" legacy messages."
This reverts commit da8fabc49a.
2017-10-12 12:14:33 -07:00
A. Jesse Jiryu Davis
df018e88e2 PYTHON-1332 - Gossip $clusterTime 2017-10-12 09:08:38 -04:00
Shane Harvey
f0b847adb8 PYTHON-1329 Refactor wire protocol message parsing.
Use _OpReply class instead of passing bytes around.
Remove unnecessary operation argument to receive message.
Move _first_batch to message.py to avoid circular import.
2017-10-09 15:11:50 -07:00
A. Jesse Jiryu Davis
dad61a058b PYTHON-1332 - Update session's last_use 2017-10-05 15:03:36 -04:00
A. Jesse Jiryu Davis
41096d5875 PYTHON-1332 - Check current user owns session 2017-10-02 12:05:11 -04:00
Shane Harvey
da8fabc49a PYTHON-1299 Remove "safe" legacy messages. 2017-09-29 12:09:24 -07:00
A. Jesse Jiryu Davis
c1ec855060 PYTHON-1332 - Send lsid with all commands 2017-09-29 14:52:26 -04:00
A. Jesse Jiryu Davis
200b699ba5 PYTHON-1332 - Prohibit using ended session 2017-09-14 23:21:43 -04:00
A. Jesse Jiryu Davis
2487e9b71f PYTHON-1332 - Session param for Collection methods 2017-09-11 17:46:44 -04:00
A. Jesse Jiryu Davis
cfb30e91c0 PYTHON-1362 - Add find/aggregate_raw_batches()
Rename find_raw to find_raw_batches, and add aggregate_raw_batches.
Rename RawBSONCursor and RawBSONCommandCursor to RawBatchCursor and
RawBatchCommandCursor.
2017-08-25 15:26:16 -04:00
A. Jesse Jiryu Davis
0534596dc5 PYTHON-1362 - Add raw_batches option to find() 2017-08-25 15:24:16 -04:00
A. Jesse Jiryu Davis
87708a2f96 PYTHON-1169 - Default maxStalenessSeconds is -1. 2016-11-08 21:52:04 -05:00
A. Jesse Jiryu Davis
f4922da97c PYTHON-1104 - maxStalenessMS -> maxStalenessSeconds. 2016-11-08 21:52:04 -05:00
Bernie Hackett
5f16e33a6d PYTHON-1150 - Add maxStalenessMS to $readPreference 2016-09-19 11:09:41 -07:00
Luke Lovett
8fdb581c6a PYTHON-1113 - Support collation per operation.
This commit add the pymongo.collation.Collation class and associated enums.  A
collation may be sent with individual write operations when connected to MongoDB
3.4+. Unlike read and write concern, a collation may not be attached to a
database or collection instance.
2016-09-07 13:45:41 -07:00
Bernie Hackett
53a7bea492 PYTHON-1022 - Drop support for Python 3.2
This change removes the u() helper from bson.py3compat
and all of its uses in the driver and tests. PyPy3 continues
to be supported since, even though it is based on python 3.2.5,
it has always supported the u string prefix.

The README and install docs are now explicit about PyPy(3) support.
2016-06-15 10:05:43 -07:00
Bernie Hackett
6c4e4b5a81 PYTHON-1065 - Support 1 for batch_size with MongoDB >= 3.2 2016-03-07 17:48:54 -08:00
Bernie Hackett
733079b149 PYTHON-1014 - Omit $readPreference from find command 2015-11-18 15:46:55 -08:00
aherlihy
ab400361cc PYTHON-1014 - Unrecognized $ operators now included in find command 2015-11-18 15:04:36 -08:00
aherlihy
ab6b3a3b1b Add support for maxAwaitTimeMS to getMore 2015-11-18 14:17:56 -08:00
aherlihy
36129ed2aa Don't set the slaveOk bit on getMore and killCursors commands 2015-11-18 14:17:56 -08:00
aherlihy
b8528100e1 PYTHON-978 - Use getMore command for CommandCursor 2015-11-18 14:12:28 -08:00
Luke Lovett
dde4a658b5 PYTHON-981 - Implement ReadConcern. 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
cab20bd7f1 PYTHON-1011 - Raise DocumentTooLarge when appropriate 2015-11-16 15:33:13 -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
875251c3d9 PYTHON-976 - Use str(exception) instead of exception.message to support Python 3. 2015-10-07 12:51:50 -07:00
Luke Lovett
b6182d0587 PYTHON-976 - Publish a CommandFailedEvent for arbitrary failures. 2015-10-07 11:08:05 -07:00