June 2014
Intermediate to advanced
696 pages
38h 52m
English
The Grid object acts as a representation of GridFS. It provides a simple interface to read and write binary data to GridFS. You can instantiate the Grid object by calling the Grid() constructor from an instance of the Db object. For example, the following code connects to MongoDB and creates a Grid object attached to the fs collection:
MongoClient.connect("mongodb://localhost/", function(err, db) { var grid= new Grid(db, 'fs');});
The Grid object provides several methods that allow you to put data into the grid, retrieve data in the grid, and remove data from the grid. The data stored in the grid is stored in binary format, so it must be put into the grid and read from the ...
Read now
Unlock full access