[DOCS-1098] Comment on: "applications/gridfs.txt" Created: 07/Feb/13  Updated: 06/Jun/13  Resolved: 06/Jun/13

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Improvement Priority: Minor - P4
Reporter: Attila Tozser Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Participants:
Days since reply: 10 years, 40 weeks, 6 days ago

 Description   

GridFS myContracts = new GridFS(myDatabase, "contracts"); // returns GridFS bucket named "contracts"
myFS.retrieveFile("smithco", new File("/tmp/smithco.pdf")); // retrieve GridFS object "smithco"

This is the GridFS file retrieve example. the second line should refer to myContracts instead of myFS.



 Comments   
Comment by auto [ 09/May/13 ]

Author:

{u'date': u'2013-05-09T16:15:34Z', u'name': u'Jorge Puente Sarr\xedn', u'email': u'puentesarrin@gmail.com'}

Message: DOCS-1098 Fixed GridFS example using Java driver

Signed-off-by: Sam Kleinman <samk@10gen.com>
Signed-off-by: Jeff Yemin <jeff.yemin@10gen.com>
Branch: v2.2
https://github.com/mongodb/docs/commit/99aa2a5d32713b028bec77c1214f0073c995d91a

Comment by auto [ 09/May/13 ]

Author:

{u'date': u'2013-05-09T16:15:34Z', u'name': u'Jorge Puente Sarr\xedn', u'email': u'puentesarrin@gmail.com'}

Message: DOCS-1098 Fixed GridFS example using Java driver

Signed-off-by: Sam Kleinman <samk@10gen.com>
Signed-off-by: Jeff Yemin <jeff.yemin@10gen.com>

Conflicts:
source/applications/gridfs.txt
Branch: v2.2
https://github.com/mongodb/docs/commit/2fcbb8558b0ea6375caa751dc11538990ace68cd

Comment by Jeffrey Yemin [ 25/Feb/13 ]

Yowza


Sent from Gmail Mobile

Comment by Attila Tozser [ 25/Feb/13 ]

More precisely from here: http://docs.mongodb.org/manual/applications/gridfs/#example-interface

Comment by Jeffrey Yemin [ 24/Feb/13 ]

Those examples refer to non-existent methods storeFile and retrieveFile. Where did you get those from?

        final DB myDatabase = new MongoClient().getDB("test");
        GridFS myFS = new GridFS(myDatabase); // returns default GridFS bucket (e.g. "fs"  collection)
        myFS.createFile(new File("/tmp/largething.mpg")); // saves the file to "fs" GridFS bucket

        GridFS myContracts = new GridFS(myDatabase, "contracts"); // returns GridFS bucket named "contracts"
        GridFSDBFile file = myContracts.findOne("smithco"); // retrieve GridFS object "smithco"
        file.writeTo(new File("/tmp/smithco.pdf")); //saves the GridFS file to the file system

Comment by Attila Tozser [ 07/Feb/13 ]

the link: http://docs.mongodb.org/manual/applications/gridfs/

Generated at Thu Feb 08 07:40:14 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.