Skip to content

Commit 8bfdb28

Browse files
author
Sam Kleinman
committed
DOCS-915 clarifying example
1 parent 8c51c73 commit 8bfdb28

File tree

1 file changed

+11
-10
lines changed

1 file changed

+11
-10
lines changed

source/applications/gridfs.txt

Lines changed: 11 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -211,17 +211,18 @@ The following is an example of the GridFS interface in Java. The example
211211
is for demonstration purposes only. For API specifics, see the relevant
212212
:doc:`driver </applications/drivers>` documentation.
213213

214+
By default, the interface must support the default GridFS bucket, named
215+
``fs``, as in the following:
216+
214217
.. code-block:: java
215218

216-
/*
217-
* default root collection usage - must be supported
218-
*/
219-
GridFS myFS = new GridFS(myDatabase); // returns a default GridFS (e.g. "fs" bucket collection)
220-
myFS.storeFile(new File("/tmp/largething.mpg")); // saves the file into the "fs" GridFS store
219+
GridFS myFS = new GridFS(myDatabase); // returns default GridFS bucket (e.g. "fs" collection)
220+
myFS.storeFile(new File("/tmp/largething.mpg")); // saves the file to "fs" GridFS bucket
221+
222+
Optionally, interfaces may support other additional GridFS buckets as
223+
in the following example:
221224

222-
/*
223-
* specified root collection usage - optional
224-
*/
225+
.. code-block:: java
225226

226-
GridFS myContracts = new GridFS(myDatabase, "contracts"); // returns a GridFS where "contracts" is root
227-
myFS.retrieveFile("smithco", new File("/tmp/smithco_20090105.pdf")); // retrieves object whose filename is "smithco"
227+
GridFS myContracts = new GridFS(myDatabase, "contracts"); // returns GridFS bucket named "contracts"
228+
myFS.retrieveFile("smithco", new File("/tmp/smithco.pdf")); // retrieve GridFS object "smithco"

0 commit comments

Comments
 (0)