Skip to content

Commit 2a42c9e

Browse files
committed
rs feedback
1 parent bf9744f commit 2a42c9e

File tree

2 files changed

+7
-23
lines changed

2 files changed

+7
-23
lines changed

source/fundamentals/gridfs.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ the ``GridFSBucket()`` constructor. The following table describes the properties
109109
**Data type**: {+string-data-type+}
110110

111111
* - ``ChunkSizeBytes``
112-
- The chunk size that GridFS splits files into. The default value is ``261120``.
112+
- The chunk size that GridFS splits files into. The default value is 255 KB.
113113

114114
**Data type**: {+int-data-type+}
115115

@@ -224,7 +224,7 @@ method. The ``GridFSUploadOptions`` class contains the following properties:
224224
* - Property
225225
- Description
226226
* - ``BatchSize``
227-
- The number of chunks to upload in each batch. The default value is ``16777216``
227+
- The number of chunks to upload in each batch. The default value is 16 MB
228228
divided by the value of the ``ChunkSizeBytes`` property.
229229

230230
**Data type**: ``int?``

source/includes/code-examples/GridFS.cs

Lines changed: 5 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -47,11 +47,7 @@ static async Task UploadFileAsync()
4747
// ASCII for "HelloWorld"
4848
byte[] bytes = { 72, 101, 108, 108, 111, 87, 111, 114, 108, 100 };
4949

50-
for (int i = 0; i < 5; i++)
51-
{
52-
await uploader.WriteAsync(bytes, 0, bytes.Length);
53-
}
54-
50+
await uploader.WriteAsync(bytes, 0, bytes.Length);
5551
await uploader.CloseAsync();
5652
}
5753
// end-open-upload-stream-async
@@ -73,11 +69,7 @@ static void UploadFile()
7369
// ASCII for "HelloWorld"
7470
byte[] bytes = { 72, 101, 108, 108, 111, 87, 111, 114, 108, 100 };
7571

76-
for (int i = 0; i < 5; i++)
77-
{
78-
uploader.Write(bytes, 0, bytes.Length);
79-
}
80-
72+
uploader.Write(bytes, 0, bytes.Length);
8173
uploader.Close();
8274
}
8375
// end-open-upload-stream
@@ -104,11 +96,7 @@ static async Task UploadFileWithOptionsAsync()
10496
// ASCII for "HelloWorld"
10597
byte[] bytes = { 72, 101, 108, 108, 111, 87, 111, 114, 108, 100 };
10698

107-
for (int i = 0; i < 5; i++)
108-
{
109-
await uploader.WriteAsync(bytes, 0, bytes.Length);
110-
}
111-
99+
await uploader.WriteAsync(bytes, 0, bytes.Length);
112100
await uploader.CloseAsync();
113101
}
114102
// end-open-upload-stream-with-options-async
@@ -135,11 +123,7 @@ static void UploadFileWithOptions()
135123
// ASCII for "HelloWorld"
136124
byte[] bytes = { 72, 101, 108, 108, 111, 87, 111, 114, 108, 100 };
137125

138-
for (int i = 0; i < 5; i++)
139-
{
140-
uploader.Write(bytes, 0, bytes.Length);
141-
}
142-
126+
uploader.Write(bytes, 0, bytes.Length);
143127
uploader.Close();
144128
}
145129
// end-open-upload-stream-with-options
@@ -216,7 +200,7 @@ static async Task FindAsync()
216200
// start-find-async
217201
var filter = Builders<GridFSFileInfo>.Filter.Empty;
218202
var files = await bucket.FindAsync(filter);
219-
await files.ForEachAsync(file => { Console.WriteLine(file.ToJson()); });
203+
await files.ForEachAsync(file => Console.Out.WriteLineAsync(file.ToJson()))
220204
// end-find-async
221205
}
222206

0 commit comments

Comments
 (0)