mongoose-harmony-gridfs
Advanced tools
Comparing version
10
index.js
@@ -24,8 +24,10 @@ 'use strict'; | ||
var id = this.get(linkPropertyName + '.' + key), | ||
gridFS = new Grid(mongoose.connection.db, bucket); | ||
gridFS = Grid(mongoose.connection.db, bucket); | ||
return Q.Promise(function(resolve, reject, notify){ | ||
if (id == null) return resolve(null); | ||
gridFS.get(id, function(err, buffer){ | ||
if (err) reject(err); | ||
resolve(buffer); | ||
if (err) resolve(null); | ||
else resolve(buffer); | ||
}); | ||
@@ -36,3 +38,3 @@ }); | ||
var self = this, | ||
gridFS = new Grid(mongoose.connection.db), | ||
gridFS = Grid(mongoose.connection.db), | ||
buffer = new Buffer(value), | ||
@@ -39,0 +41,0 @@ previous = this.get(linkPropertyName + '.' + key); |
{ | ||
"name": "mongoose-harmony-gridfs", | ||
"version": "0.1.1", | ||
"version": "0.1.2", | ||
"description": "Mongoose plugin for GridFS based on ES6 Harmony", | ||
@@ -5,0 +5,0 @@ "author": "Dexter Miguel <divmgl@gmail.com>", |
7074
0.77%43
2.38%