mongoose-gridfs
Advanced tools
Comparing version 0.2.0 to 0.3.0
@@ -27,7 +27,10 @@ 'use strict'; | ||
//initialize grid fs database | ||
var db = this.options.mongooseConnection || mongoose.connection.db; | ||
//get either option connection or mongoose connection | ||
var conn = this.options.mongooseConnection || mongoose.connection; | ||
//TODO ensure mongoose connection | ||
this.storage = new Grid(db); | ||
//Check if mongoose is connected. | ||
if(conn.readyState !== 1) { | ||
throw new Error('Mongoose is not connected'); | ||
} | ||
this.storage = new Grid(conn.db); | ||
} | ||
@@ -34,0 +37,0 @@ |
{ | ||
"name": "mongoose-gridfs", | ||
"version": "0.2.0", | ||
"version": "0.3.0", | ||
"description": "mongoose gridfs on top of gridfs-stream", | ||
@@ -33,15 +33,15 @@ "main": "index.js", | ||
"devDependencies": { | ||
"async": "^2.3.0", | ||
"chai": "^3.5.0", | ||
"async": "^2.5.0", | ||
"chai": "^4.1.2", | ||
"grunt": "^1.0.1", | ||
"grunt-contrib-jshint": "^1.1.0", | ||
"grunt-contrib-watch": "^1.0.0", | ||
"grunt-mocha-test": "^0.13.2", | ||
"grunt-mocha-test": "^0.13.3", | ||
"is-stream": "^1.1.0", | ||
"jshint-stylish": "^2.2.1", | ||
"load-grunt-tasks": "^3.5.2", | ||
"mime": "^1.3.4", | ||
"mocha": "^3.2.0", | ||
"mongoose": "^4.9.3" | ||
"mime": "^2.0.3", | ||
"mocha": "^4.0.1", | ||
"mongoose": "^4.12.4" | ||
} | ||
} |
@@ -21,3 +21,3 @@ mongoose-gridfs | ||
//mongoose connect | ||
var connection = mongoose.connect('mongodb://localhost/test'); | ||
mongoose.connect('mongodb://localhost/test'); | ||
@@ -28,3 +28,3 @@ //instantiate mongoose-gridfs | ||
model:'Attachment', | ||
mongooseConnection: connection | ||
mongooseConnection: mongoose.connection | ||
}); | ||
@@ -31,0 +31,0 @@ |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
21341
482