@coya/database
Advanced tools
Comparing version 0.0.9 to 0.0.10
@@ -30,4 +30,10 @@ const crypto = require('crypto'); | ||
static createCappedCollection(collectionName, size, max) { | ||
logs.info('Creating capped collection "' + collectionName + '" of size = ' + size + ' and max = ' + max + '...'); | ||
return db.createCollection(collectionName, {capped: true, size:size, max: max}); | ||
return Database.collectionExists(collectionName) | ||
.then(function(exists) { | ||
if(!exists) { | ||
logs.info('Creating capped collection "' + collectionName + '" of size = ' + size + ' and max = ' + max + '...'); | ||
return db.createCollection(collectionName, {capped: true, size: size, max: max}); | ||
} | ||
return Promise.resolve(); | ||
}); | ||
} | ||
@@ -34,0 +40,0 @@ |
{ | ||
"name": "@coya/database", | ||
"version": "0.0.9", | ||
"version": "0.0.10", | ||
"description": "MongoDB database service", | ||
@@ -5,0 +5,0 @@ "main": "database.js", |
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
10983
329