Commit Graph

347 Commits

Author SHA1 Message Date
Luke Lovett
29df784185 PYTHON-989 - Fix find_one_and_write_concern test when run with authentication. 2015-11-18 16:50:55 -08:00
Bernie Hackett
58781f12d6 PYTHON-1014 - Minor test fix 2015-11-18 15:31:54 -08:00
aherlihy
ab400361cc PYTHON-1014 - Unrecognized $ operators now included in find command 2015-11-18 15:04:36 -08:00
Luke Lovett
e4d3392f90 PYTHON-472 - Add a RawBSONDocument class that decodes its comprising bytes only on-demand.
This provides an API for inserting and returning raw BSON.
2015-11-18 15:00:09 -08:00
Luke Lovett
504d4b206c PYTHON-989 - Don't use unsatisfiable write concern in tests against non-replica sets. 2015-11-18 14:20:14 -08:00
Luke Lovett
7f14b69c3c PYTHON-989 - Check for write concern errors when using the findAndModify command. 2015-11-18 14:20:14 -08:00
aherlihy
894775c70c Prohibit bypass_document_validation with w=0 2015-11-18 14:17:56 -08:00
aherlihy
44872948a4 Revised partial index tests for new explain format 2015-11-18 14:17:56 -08:00
aherlihy
f5b44ea35f PYTHON-982 - Support bypassDocumentValidation 2015-11-18 14:17:56 -08:00
aherlihy
9364abe46a PYTHON-990 - Support partial indexes 2015-11-18 14:12:28 -08:00
Luke Lovett
2942d50c34 PYTHON-989 - Support write concern in find_and_modify, find_one_and_XXX. 2015-11-18 14:12:28 -08:00
Bernie Hackett
cab20bd7f1 PYTHON-1011 - Raise DocumentTooLarge when appropriate 2015-11-16 15:33:13 -08:00
Bernie Hackett
55578f9405 Use modern PyMongo in tests. 2015-04-20 15:12:35 -07:00
A. Jesse Jiryu Davis
c6c8393a61 PYTHON-894 - Skip aggregation cursor test on old mongods. 2015-04-17 16:19:45 -04: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
3716b449cc PYTHON-871 - Fix encoding of defaultdict. 2015-03-27 14:35:09 -07:00
Bernie Hackett
aec685b374 Fix up copyright dates. 2015-03-25 11:55:02 -07:00
Bernie Hackett
3c45c726e7 PYTHON-820 - Set batchSize on aggregate CommandCursor. 2015-03-17 09:00:37 -07:00
Bernie Hackett
14ce3af058 PYTHON-861 - Implement list_indexes. 2015-03-16 08:00:58 -07:00
Bernie Hackett
9c4d01701b PYTHON-861 - Implement create_indexes. 2015-03-16 07:56:46 -07:00
Bernie Hackett
0f6b05819c PYTHON-861 - Fix dropDups tests. 2015-03-14 18:09:15 -07:00
Bernie Hackett
f93c73aa73 PYTHON-861 - create/ensure index changes
- Deprecate ensure_index
- Remove caching from create_index
- In create_index, remove support for the cache_for param, and the
  bucket_size and drop_dups aliases (they all remain in ensure_index)
- GridFS uses create_index
- Fix up tests.
2015-03-14 13:38:13 -07:00
Bernie Hackett
4fd6f8a0b1 PYTHON-854 max_pool_size -> maxPoolSize
With this change the max_pool_size named parameter to
MongoClient is removed. It is replaced by the maxPoolSize
MongoDB URI option, which can be passed in a URI, or as a
keyword argument to MongoClient.
2015-03-09 10:08:13 -07:00
Bernie Hackett
d69f76d380 Finalize option locations and exports.
- Move ReturnDocument to pymongo.collection.
- Change ReturnDocument.Before to ReturnDocument.BEFORE
- Change ReturnDocument.After to ReturnDocument.AFTER
- Add pymongo.cursor.CursorType.
- Move pymongo.cursor.NON_TAILABLE and friends to attributes of CursorType.
- read_preferences.ReadPreference is once again an "enum".
- Fix docs for read_preferences.ReadPreference.
- Rename pymongo.options to pymongo.operations.
- Export CursorType, ReturnDocument, WriteConcern, and public classes
  from pymongo.opertions through pymongo/__init__.py
- Fix up a number of documentation issues in the process.
2015-03-05 11:35:46 -08:00
Bernie Hackett
3f3b6bedfc PYTHON-846 - Database.connection -> Database.client 2015-02-25 11:57:39 -08:00
Bernie Hackett
c0474a00bf Debug a test. 2015-02-20 16:24:46 -08:00
Bernie Hackett
839893939e PYTHON-821 - Deprecated legacy API.
This commit deprecates insert, update, save, and remove. Each
now raises DeprecationWarning at stacklevel 2. This change also
updates all tutorials and example documentation to use the new
CRUD API, tests the deprecations, and fixes up a few more tests
that were still using the legacy API.
2015-02-20 15:41:45 -08:00
Bernie Hackett
aa090fe393 PYTHON-821 - Small test fixes. 2015-02-19 10:36:42 -08:00
Bernie Hackett
a817fa9a28 PYTHON-821 - Add test_legacy_api.py 2015-02-19 09:32:14 -08:00
Bernie Hackett
4588f6e0e0 Debug some tests. 2015-02-17 17:07:35 -08:00
Bernie Hackett
30af616009 PYTHON-821 - Migrate most tests to new the CRUD API. 2015-02-13 08:46:43 -08:00
Bernie Hackett
f9243f0ad9 PYTHON-821 - Implement insert_many 2015-02-12 16:28:46 -08:00
Bernie Hackett
4d6bdb1097 PYTHON-821 - Implement delete_one and delete_many. 2015-02-12 11:04:58 -08:00
Bernie Hackett
e7866dbd19 PYTHON-821 - Implement replace_one, update_one, and update_many. 2015-02-11 20:01:16 -08:00
Bernie Hackett
b9cd7b627b PYTHON-821 - Introduce results and options modules. 2015-02-11 13:52:51 -08:00
Bernie Hackett
df4e5269b3 PYTHON-821 - Implement insert_one. 2015-02-11 12:48:50 -08:00
Bernie Hackett
7416e6595c PYTHON-821 - Implement find_one_and_*.
This change also deprecates find_and_modify. Migrate
to find_one_and_delete, find_one_and_update, and/or
find_one_and_replace.
2015-02-10 12:09:47 -08:00
A. Jesse Jiryu Davis
a2c13090d8 PYTHON-826 Move codec_options submodule from pymongo to bson. 2015-02-02 09:38:49 -05:00
A. Jesse Jiryu Davis
0a75f04384 Remove pre-MongoDB-2.0 version checks from tests. 2015-01-26 16:19:12 -05:00
A. Jesse Jiryu Davis
07e3884305 Longer timeouts in test_insert_large_batch.
Amazon build slaves can be alarmingly slow.
2015-01-22 17:40:45 -05:00
A. Jesse Jiryu Davis
3b4532244b Fix and clarify test_insert_large_batch.
Using separate collections avoids an apparent race in mongos 2.6's
dropCollection, as well as clarifying the test. Further clarify it by
explicitly naming and specifying batches and the ids of documents within them.
2015-01-22 16:08:47 -05:00
A. Jesse Jiryu Davis
a1ccdcd87a Debug test_insert_large_batch. 2015-01-22 10:29:23 -05:00
A. Jesse Jiryu Davis
7af79ad612 Update comments in test_insert_large_batch. 2015-01-20 21:35:26 -05:00
A. Jesse Jiryu Davis
ece5496658 Race in test_continue_on_error. 2015-01-20 21:27:35 -05:00
behackett
c07e543e58 PYTHON-820 - API changes for find/find_one to comply with CRUD spec.
- Changed parameter names (default values and behaviors remain the same):
  - spec (spec_or_id in find_one) -> filter
  - fields -> projection
  - partial -> allow_partial_results

- The "timeout" option is renamed to "no_cursor_timeout" with its default
  changed to False.

- The tailable, await_data, and exhaust options will be replaced with a
  cursor_type option. Valid values:
  - cursor.NON_TAILABLE
  - cursor.TAILABLE
  - cursor.TAILABLE_AWAIT
  - cursor.EXHAUST

- The following options are added:
  - oplog_replay (bool - default False) - only valid with tailable cursors
    against the oplog.
  - modifiers (document - default None) - A dict of query modifiers. See
    http://docs.mongodb.org/manual/reference/operator/query-modifier/#modifiers for
    options.

- The following options are removed, replaced by the "modifiers" option:
  - max_scan
  - snapshot

- The as_class option is removed. Use Collection.with_options instead.
2015-01-19 22:10:56 -08:00
Bernie Hackett
71e083d81b PYTHON-820 - count and distinct changes to comply with CRUD. 2015-01-14 16:56:00 -08:00
Bernie Hackett
5d429bfe46 PYTHON-820 - Change aggregate to comply with the CRUD spec. 2015-01-14 13:02:33 -08:00
Bernie Hackett
b7b627d822 PYTHON-798 - Make common.BaseObject immutable
This change makes the codec_options, read_preference, and
write_concern attributes of MongoClient, Database, and
Collection read only. If you need to change any of these
options per-instance use MongoClient.get_database,
Database.get_collection, or Collection.with_options instead.
2015-01-12 10:35:28 -08:00
Bernie Hackett
1b1457ab1f PYTHON-677 - Finish transition to WriteConcern. 2014-12-20 22:34:48 -08:00
Bernie Hackett
a72d95b229 PYTHON-803 - Don't use Collection.find() for commands.
This change introduces a _command helper in the helpers
module, used by Database.command and various internal and
external command helpers instead of iterating a Cursor
instance.

This change also introduces a small incompatibility with
earier versions. The as_class and fields options have been
removed from Database.command. They were never documented
and only used by some internal helpers. This also removes
the documented uuid_subtype option. A forthcoming API
refactor will replace that functionality.
2014-12-16 14:37:43 -08:00