Commit Graph

137 Commits

Author SHA1 Message Date
Bernie Hackett
9d47f1cd3d PYTHON-691 - Fix UserWarning command issues.
Don't raise UserWarning for helpers and internal calls to
commands that do not obey read preference.
2014-05-01 09:21:52 -07:00
A. Jesse Jiryu Davis
3a4d894afa Lower default GridFS chunk size to 255k, PYTHON-661. 2014-03-24 16:37:10 -04:00
A. Jesse Jiryu Davis
ea38602bef Fix GridFS example code. 2014-02-25 14:50:01 -05:00
A. Jesse Jiryu Davis
2fa1750b07 Update copyright notices and company name. 2014-01-31 09:36:46 -05:00
Bernie Hackett
f423c079d9 Fix a few documentation issues. 2014-01-14 10:06:16 -08:00
Bernie Hackett
3a197c8467 Fix GridOutCursor iteration in py3 PYTHON-310 2014-01-13 18:14:13 -08:00
A. Jesse Jiryu Davis
a80b517849 Merge pull request #222 from 3rf/PYTHON-621
PYTHON-621: Fixed GridOut.read(0) returning string in Python 3
2014-01-09 13:04:30 -08:00
Kyle Erf
464941e5ad PYTHON-621: Fixed GridOut.read(0) returning string in Python 3 2014-01-07 09:51:56 -08:00
Kyle Erf
237754dbef PYTHON-310: Added find() method to gridfs
Allows iteration through arbitrary queries against the files collection using
a new GridOutCursor class.
2014-01-06 14:57:00 -08:00
A. Jesse Jiryu Davis
066dd33935 Further GridOut.readline optimization. 2013-12-20 10:39:24 -05:00
A. Jesse Jiryu Davis
df60a5fa97 Off-by-one in GridOut.readline(). 2013-12-20 10:39:06 -05:00
Curtis Vogt
3649a3a0d7 Improved performance of GridOut readline by creating readchunk method.
Previously readline would read one byte at a time using the read
method. By reading one byte at a time we would be slicing the buffer
over and over again causing readline to use more CPU than necessary.
2013-12-20 10:39:06 -05:00
A. Jesse Jiryu Davis
2a1724c633 Option to lazily connect GridFS and GridOut, always lazily connect GridIn. 2013-12-05 15:16:18 -05:00
A. Jesse Jiryu Davis
394711330d Ensure GridFS.list() never includes None, PYTHON-598. 2013-12-05 10:04:47 -05:00
A. Jesse Jiryu Davis
fd9abff394 Docstring grammar 2013-01-31 11:33:25 -05:00
Ross Lawley
2435f8609d GridFS.new_file fails to raise FileExists
When using a manual _id - PYTHON-453
2013-01-07 14:30:04 +00:00
behackett
139459beb9 Replace safe with w in internal methods PYTHON-437 2012-11-19 16:29:15 -08:00
A. Jesse Jiryu Davis
b47f679a17 GridFS writes must be in request PYTHON-423 2012-11-19 16:25:09 -05:00
A. Jesse Jiryu Davis
c503f1dbad Higher-performance solution to PYTHON-417 2012-10-18 14:51:03 -04:00
A. Jesse Jiryu Davis
0223027ecf Ensure writing a chunk to an existing file raises FileExists PYTHON-417 2012-10-15 19:14:35 -04:00
A. Jesse Jiryu Davis
713fecedbf Insert chunks into GridFS with safe=True to avoid out-of-order inserts via mongos PYTHON-417
Inserts into fs.chunks via mongos, even though they're using a single
connection, can succeed out-of-order due to the writebackListener.
We mustn't call "filemd5" until all inserts are complete, which we
ensure by calling getLastError after inserting each chunk.
2012-10-15 17:17:15 -04:00
A. Jesse Jiryu Davis
ab024028f2 Add GridOut attribute 'filename' as alias for 'name' PYTHON-412 2012-09-26 16:26:39 -04:00
A. Jesse Jiryu Davis
2446ca96c8 Add GridIn attribute 'name' as alias for 'filename' PYTHON-412 2012-09-26 16:26:39 -04:00
A. Jesse Jiryu Davis
4fa7a6fa17 Send to server any attributes set on GridIn before close() PYTHON-411 2012-09-26 16:26:39 -04:00
A. Jesse Jiryu Davis
0a5b98721c Spelling 2012-09-14 12:56:11 -04:00
behackett
c188836d64 Fallback to StringIO if cStringIO doesn't exist. 2012-08-03 14:28:53 -07:00
A. Jesse Jiryu Davis
f275b2291a Implement read preferences for distributing reads among replica set members PYTHON-367
Replace the 'mongo' dict with a Member object everywhere in ReplicaSetConnection.
A handful of commands obey read preferences; most are always sent to primary.
Track a 5-sample moving average of each replica set member's ping time.
Connection detects whether it's connected to primary, secondary, or mongos.
2012-07-25 00:05:06 -04:00
behackett
e0fcc9825f Fix a minor docstring issue. 2012-04-20 15:57:24 -07:00
behackett
0ee7170cc2 It's 2012... 2012-04-19 12:40:38 -07:00
Bernie Hackett
ef803527bb Python 3 gridfs package changes PYTHON-84 2012-03-22 14:42:34 -07:00
behackett
a4ea04cb7f Guard against PHP-237 - PYTHON-290 2011-11-11 15:49:52 -08:00
behackett
4fa59c2fd8 Query GridFS from a secondary/slave PYTHON-263 2011-11-01 21:08:41 -07:00
Dan Crosta
59758053a0 avoid making extra queries when using get_[last_]version 2011-09-29 13:02:46 -07:00
behackett
5948ed94b5 Don't add a _closed field to files PYTHON-278
GridIn was adding a _closed field to each file
in the files collection. This seems incorrect and
adds another round trip to the server when closing
the file.
2011-08-31 14:40:09 -07:00
Alexey Borzenkov
7b0d289982 PYTHON-271: fix GridFS loss of data 2011-08-15 14:01:29 -07:00
Josip Delic
085a7e7d30 also use StringIO for writing strings in gridfs performance boost 2011-05-29 08:28:28 -07:00
Bernie Hackett
10b451a3cd close method and code/test cleanups PYTHON-209 2011-05-29 07:39:20 -07:00
Jonas Haag
09017cb53c Allow GridOut to be used in a with statement. (PYTHON-209) 2011-05-29 06:57:51 -07:00
behackett
a048cc63b2 Fix version numbers in a few comments. 2011-05-06 12:07:33 -07:00
Dan Crosta
23bf1bb2a5 always ensure_index, it has minimal overhead 2011-04-28 12:03:54 -07:00
Dan Crosta
ae189fa7dd ensure_index when querying by filename only 2011-04-28 12:03:54 -07:00
Dan Crosta
96c66f5269 whoops, meant 1.10.1+ 2011-04-28 12:03:54 -07:00
Dan Crosta
b95dfcdaa1 use versionchanged for default value of filename 2011-04-28 12:03:54 -07:00
Dan Crosta
10e6cfea50 no need to copy the kwargs dict 2011-04-28 12:03:54 -07:00
Dan Crosta
80f7fa7f79 be consistent with how we limit fields in other methods 2011-04-28 12:03:54 -07:00
Dan Crosta
2683affc4d clean up docstrings per behackett's comments 2011-04-28 12:03:54 -07:00
Dan Crosta
afeda6df59 allow querying by metadata in GridFS.get_[last_]version() 2011-04-28 12:03:54 -07:00
Dan Crosta
b4665592ec only return _id when querying from GridFS.get_version() 2011-04-28 12:03:54 -07:00
Dan Crosta
8df44533e6 correct a typo in GridOut.__getattr__ 2011-04-26 14:31:14 -07:00
Mathias Stearn
066be855b9 more documentation PYTHON-168 2010-10-21 17:29:22 -04:00