lib/gridfs/grid_store.js
function(self, chunkNumber, options, callback) {
  if (typeof options === 'function') {
    callback = options;
    options = {};
  }

  options = options || self.writeConcern;
  options.readPreference = self.readPreference;
  // Get the nth chunk
  self
    .chunkCollection()
    .findOne({ files_id: self.fileId, n: chunkNumber }, options, function(err, chunk) {
      if (err) return callback(err);

      var finalChunk = chunk == null ? {} : chunk;
      callback(null, new Chunk(self, finalChunk, self.writeConcern));
    });
}
function(self, chunkNumber, options, callback) {
  if (typeof options === 'function') {
    callback = options;
    options = {};
  }

  options = options || self.writeConcern;
  options.readPreference = self.readPreference;
  // Get the nth chunk
  self
    .chunkCollection()
    .findOne({ files_id: self.fileId, n: chunkNumber }, options, function(err, chunk) {
      if (err) return callback(err);

      var finalChunk = chunk == null ? {} : chunk;
      callback(null, new Chunk(self, finalChunk, self.writeConcern));
    });
}
function ( self , chunkNumber , options , callback ) { if ( typeof options === 'function' ) { callback = options ; options = { } ; } options = options || self . writeConcern ; options . readPreference = self . readPreference ; // Get the nth chunk self . chunkCollection ( ) . findOne ( { files_id : self . fileId , n : chunkNumber } , options , function ( err , chunk ) { if ( err ) return callback ( err ) ; var finalChunk = chunk == null ? { } : chunk ; callback ( null , new Chunk ( self , finalChunk , self . writeConcern ) ) ; } ) ; }
Gets the nth chunk of this file.
@ignore
Gets the nth chunk of this file .