Database Reference
In-Depth Information
return GridOut(self.__collection, file_id)
File "/usr/lib/python2.6/site-packages/pymongo-2.5.2-py2.6-linux-x86_64.egg/
gridfs/grid_file.py", line 392, in __init__
(files, file_id))
gridfs.errors.NoFile: no file in gridfs collection Collection(Database(Conne
ction('localhost', 27017), u'test'), u'fs.files') with _id ObjectId('51cb65b
e2f50332093f67b98') >>>
These results could look a bit scary, but they are just PyMongo's way of saying that it
couldn't find the file. This isn't surprising, because you just deleted it!
Summary
In this chapter, you undertook a fast-paced tour of GridFS. You learned what GridFS is,
how it fits together with MongoDB, and how to use its basic syntax. This chapter didn't
explore GridFS in great depth, but in the next chapter, you'll learn how to integrate GridFS
with a real application using PHP. For now, it's enough to understand how GridFS can
save you time and hassle when storing files and other large pieces of data.
In the next chapter, you'll start putting what you've learned to real use—specifically,
you'll learn how to build a fully functional address book!
 
Search WWH ::




Custom Search