GridFS docs fixes.

This commit is contained in:
A. Jesse Jiryu Davis 2016-10-30 20:59:58 -04:00
parent cdb40fb747
commit 42c5df83fb

View File

@ -609,8 +609,9 @@ class GridFSBucket(object):
# Get _id of file to read
file_id = fs.upload_from_stream("test_file", "data I want to store!")
# Get file to write to
file = open('myfile','rwb')
file = open('myfile','wb+')
fs.download_to_stream(file_id, file)
file.seek(0)
contents = file.read()
Raises :exc:`~gridfs.errors.NoFile` if no file with file_id exists.
@ -715,12 +716,13 @@ class GridFSBucket(object):
Defaults to -1 (the most recent revision).
:Note: Revision numbers are defined as follows:
0 = the original stored file
1 = the first revision
2 = the second revision
etc...
-2 = the second most recent revision
-1 = the most recent revision
- 0 = the original stored file
- 1 = the first revision
- 2 = the second revision
- etc...
- -2 = the second most recent revision
- -1 = the most recent revision
"""
validate_string("filename", filename)
@ -764,12 +766,13 @@ class GridFSBucket(object):
Defaults to -1 (the most recent revision).
:Note: Revision numbers are defined as follows:
0 = the original stored file
1 = the first revision
2 = the second revision
etc...
-2 = the second most recent revision
-1 = the most recent revision
- 0 = the original stored file
- 1 = the first revision
- 2 = the second revision
- etc...
- -2 = the second most recent revision
- -1 = the most recent revision
"""
gout = self.open_download_stream_by_name(filename, revision)
for chunk in gout: