GridStore object acts as a representation of a binary file stored in the MongoDB GridFS. It provides the basic file interface to read and write files stored in GridFS. For example, you can stream reads and writes from GridFS, read chunks of a file without needing to read the entire file, etc. These are all things that you could do within Node.js, but without the added benefits that come with MongoDB, such as replication and high availability.
You can instantiate the
GridStore object by calling the
GridStore() constructor from an instance of the
Db object. For example, the following code connects to MongoDB and creates a
GridStore object attached to the