Commit Graph

84 Commits

Author SHA1 Message Date
Ross Lawley
3f5cb6ff28 Fix cursor cloning issue with deepcopy and regex #179 2013-05-08 13:31:38 +00:00
A. Jesse Jiryu Davis
c758efcb34 Rename test_connection -> test_client, test_replica_set_connection -> test_replica_set_client PYTHON-451 2013-02-11 21:33:55 -05:00
A. Jesse Jiryu Davis
d35bec12e5 Tests use MongoClient instead of Connection PYTHON-451 2013-02-11 20:57:17 -05:00
Ross Lawley
828aad3aad Ensure deepcopy clones using the correct type - PYTHON-459 2013-01-08 09:53:39 +00:00
behackett
7603b9db79 Support "text" as an index specifier PYTHON-456
This also fixes a few documentation issues around
index types.
2013-01-04 10:44:16 -08:00
Ross Lawley
a36b836cbd Clone needs to handle regular expressions as well PYTHON-421 2012-11-08 09:08:24 +00:00
Ross Lawley
096c312e21 Implemented copy and deepcopy for cursors
Cursors now define __copy__ and __deepcopy__
and use the deepcopy implementation for clone()

PYTHON-421 PYTHON-399
2012-10-24 15:37:16 +00:00
Ross Lawley
8afa98dd55 Don't wrap query spec when querying $cmd - PYTHON-403
Don't include $readPreferences when querying $cmd unless
the command is ok to be sent to a secondary
2012-10-03 07:44:13 +00:00
A. Jesse Jiryu Davis
461e2529f7 Informative message whenever skipping a test 2012-08-21 23:24:47 -04:00
behackett
0ee7170cc2 It's 2012... 2012-04-19 12:40:38 -07:00
A. Jesse Jiryu Davis
266b3e97fa Fix kill-cursors tests and remove redundant tests 2012-04-16 14:13:07 -04:00
behackett
12592be1fe Python 3 unittest changes PYTHON-84. 2012-03-28 11:53:47 -07:00
behackett
2d21ba9376 Replace deprecated unittest assert method aliases.
assert_ -> assertTrue
assertEquals -> assertEqual

This is needed to clean up deprecation warnings
in python >= 3.2
2012-03-16 17:20:21 -07:00
A. Jesse Jiryu Davis
91d17eed98 PEP8 style compliance in unittesting code 2011-11-23 13:56:55 -05:00
A. Jesse Jiryu Davis
1869e60fe8 Add tests for cursor get_more() and for unique index creation with drop_dups=True on Mongo < 1.9.2 2011-11-23 10:17:56 -05:00
behackett
aeca6bf66e Add Cursor.close for use with PyPy, Jython, etc. 2011-09-19 12:11:16 -07:00
behackett
2e98b15e5f Add a few more tests PYTHON-277 2011-08-31 10:08:13 -07:00
Dan Crosta
522e4b4602 updated with bernie's help 2011-08-31 09:58:50 -07:00
behackett
42c2ce4dd6 Add a manipulate option to find(_one) PYTHON-224
Leaving this set to True by default so there are no
surprises when folks upgrade. We probably want to make
False the default in a later release.
2011-07-20 17:41:29 -07:00
behackett
9c47f3c649 Cursor add_option/remove_option PYTHON-242
You can now set and unset arbitrary query flags.

Set the tailable flag:
cursor = db.coll.find().add_option(2)

Now unset it:
cursor.remove_option(2)
2011-07-10 16:51:38 -07:00
behackett
0c458819f3 Fix cursor clone bug introduced with await_data
...and made worse with partial. Also improving
unit test that should catch this kind if thing
in the future.
2011-07-10 14:03:18 -07:00
Bernie Hackett
3d76572ed0 PEP8 and unit test fixes PYTHON-39 2011-05-29 09:26:36 -07:00
Mher Movsisyan
5628d93bfc Add 'with' statement support to cursors PYTHON-39 2011-05-29 09:04:08 -07:00
behackett
2ed05bec70 PEP8 cleanups. 2011-04-06 14:57:17 -07:00
behackett
58348322b3 Fix as_class bug in cursor.clone() PYTHON-173
There was also another issue here with the order
of parameters passed to the clone.
2011-04-01 12:43:07 -07:00
Mike Dirolf
9c182809f3 Create a separate bson package PYTHON-60
Many of the pymongo modules have been moved into the bson
package. Aliases for those modules have been added to the pymongo
package, without deprecation warnings for now. Application developers
should begin to use the bson namespace, as deprecation of moved
modules will probably begin in the next release.
2010-09-14 13:52:50 -04:00
Mike Dirolf
08ffa4f822 add batch_size() to Cursor PYTHON-161 2010-09-08 15:34:05 -04:00
Mike Dirolf
97c90fae30 special case slice w/ same start & stop to return empty cursor PYTHON-85 2010-09-02 15:10:32 -04:00
Mike Dirolf
08830fbc17 no more byLocation_size 2010-08-30 11:08:55 -04:00
Mike Dirolf
f3cf5bb91a clean up max_scan stuff 2010-05-11 10:51:52 -04:00
Mike Dirolf
b989e3e34d improvements to the db.command api 2010-03-19 16:17:59 -04:00
Mike Dirolf
5371b627bb remove use of deprecated options arg from tests 2010-03-10 11:45:02 -05:00
Mike Dirolf
2cafc867e6 use capped collection for tailable test 2010-03-10 09:53:28 -05:00
Mike Dirolf
3d7240e57f It's 2010! 2010-01-30 10:48:26 -05:00
Mike Dirolf
d80de9cb13 minor: remove all uses of types module 2010-01-26 13:31:36 -05:00
Mike Dirolf
a7e0e59ee0 minor: complete removal of some things that were deprecated in version <= 1.2 2010-01-26 11:54:39 -05:00
Mike Dirolf
78c825b548 DEPRECATE db._command in favor of db.command, which is now part of the documented API 2010-01-04 10:34:43 -05:00
Mike Dirolf
99f08e541e DEPRECATING method style access for several methods:
Connection.host() and port(), Database.connection() and name(),
and Collection.database(), name() and full_name(). Use attribute/property
style access for all of these instead now.
2009-12-15 17:04:24 -05:00
Mike Dirolf
57bd445cef fix for Cursor.__getitem__ after skip(), better docs for Cursor.__getitem__ 2009-11-30 17:09:31 -05:00
Mike Dirolf
3d76a468da support for distinct w/ queries - Cursor.distinct 2009-11-30 15:57:48 -05:00
Mike Dirolf
f6fbb004b0 replace the recently added size() method with an optional argument to count(), and use a db command instead of client-side math 2009-11-14 09:34:00 -08:00
Mike Dirolf
e63cf5d402 DEPRECATING Cursor.__len__ in favor of Cursor.size
The reason for this deprecation is a bit complex:
list(...) calls _PyObject_LengthHint to guess how much space will be
required for the returned list. That method in turn calls __len__.
Therefore, calling list(...) on a Cursor instance would require at least
two round trips to the database if we keep __len__ - this makes it about
twice as slow as [x for x in Cursor], which isn't obvious to users.
Not defining __len__ here makes performance more consistent
2009-11-11 11:13:26 -05:00
Mike Dirolf
39774f4f14 minor: use more specific version for version specific tests, fix test now that server does return an error on capped collection remove 2009-10-26 10:17:20 -04:00
Mike Dirolf
13631ba13b minor: format 2009-10-21 16:23:32 -04:00
Mike Dirolf
3a6d0ae8de add tailable option to find() to use a tailable cursor 2009-10-21 16:19:18 -04:00
Mike Dirolf
814e6f0eec minor: update test to pass against devel as well as 1.0 2009-10-21 14:02:35 -04:00
Mike Dirolf
2b82db6212 deprecate setting slave_okay on individual queries 2009-10-14 17:26:47 -04:00
Mike Dirolf
6913a0f35c read only collection property for Cursor instances 2009-10-13 10:23:45 -04:00
Mike Dirolf
dd0362c8f0 minor: allow long index for getitem 2009-09-30 11:20:39 -04:00
Mike Dirolf
bb13d98002 add __len__ method to cursors 2009-09-29 11:43:02 -04:00