ric-utils-misc
Advanced tools
Comparing version 1.0.60 to 1.0.61
@@ -136,19 +136,15 @@ /* | ||
function capped(db, name, size, callback) { | ||
db.collection(name, (err, collection) => { | ||
const collection = db.collection(name); | ||
collection.isCapped((err, capped) => { | ||
if (err) { | ||
return callback(new Error(err)); | ||
return callback(null, collection); | ||
} | ||
collection.isCapped((err, capped) => { | ||
if (err) { | ||
return callback(null, collection); | ||
} | ||
if (capped) { | ||
return callback(null, collection); | ||
} | ||
if (capped) { | ||
return callback(null, collection); | ||
} | ||
db.command({ convertToCapped: name, size, autoIndexId: true }, err => { | ||
callback(err ? new Error(err) : null, collection); | ||
}); | ||
db.command({ convertToCapped: name, size, autoIndexId: true }, err => { | ||
callback(err ? new Error(err) : null, collection); | ||
}); | ||
@@ -155,0 +151,0 @@ }); |
{ | ||
"name": "ric-utils-misc", | ||
"version": "1.0.60", | ||
"version": "1.0.61", | ||
"description": "Miscellaneous utility functions", | ||
@@ -5,0 +5,0 @@ "main": "index", |
44926
1660