Permalink
Browse files

Merge pull request #40 from birthdayalarm/open_gridfs_file_by_id

Allow opening a file by id and name
  • Loading branch information...
2 parents 9091bf3 + 987f8fb commit b0c78813316716ef67159140bcc9670440caf7ef @guileen committed Mar 23, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 lib/mongoskin/gridfs.js
View
4 lib/mongoskin/gridfs.js
@@ -11,13 +11,13 @@ var SkinGridStore = exports.SkinGridStore = function(skinDb) {
* @param filename: filename or ObjectId
* callback(err, gridStoreObject)
*/
-SkinGridStore.prototype.open = function(filename, mode, options, callback){
+SkinGridStore.prototype.open = function(id, filename, mode, options, callback){
if(!callback){
callback = options;
options = undefined;
}
this.skinDb.open(function(err, db) {
- new GridStore(db, filename, mode, options).open(callback);
+ new GridStore(db, id, filename, mode, options).open(callback);
});
}

0 comments on commit b0c7881

Please sign in to comment.