File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -211,17 +211,18 @@ The following is an example of the GridFS interface in Java. The example
211211is 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"
You can’t perform that action at this time.
0 commit comments