viewmodel
Advanced tools
Comparing version 0.5.4 to 0.5.5
@@ -181,2 +181,22 @@ var mongo = require('mongodb') | ||
// __ensureIndexes:__ this function is used to create indexes defined in repo. | ||
// | ||
// `repo.ensureIndexes()` is run on repo.checkConnection() | ||
ensureIndexes: function() { | ||
var self = this; | ||
if (!this.isConnected || !this.collectionName || !this.indexes) return; | ||
this.indexes.forEach(function(index) { | ||
var options; | ||
index = index.index ? index.index : index; | ||
options = index.options ? index.options : {}; | ||
self.client.ensureIndex(self.collectionName, index, options, function(err, indexName) { | ||
// nothing todo. | ||
}); | ||
}); | ||
}, | ||
// __checkConnection:__ Use this function to check if all is initialized correctly. | ||
@@ -188,2 +208,3 @@ // | ||
this.collection = new mongo.Collection(this.client, this.collectionName); | ||
this.ensureIndexes(); | ||
} | ||
@@ -190,0 +211,0 @@ }, |
{ | ||
"author": "adrai", | ||
"name": "viewmodel", | ||
"version": "0.5.4", | ||
"version": "0.5.5", | ||
"private": false, | ||
@@ -6,0 +6,0 @@ "main": "index.js", |
# Introduction | ||
[![Build Status](https://secure.travis-ci.org/adrai/node-viewmodel.png)](http://travis-ci.org/adrai/node-viewmodel) | ||
[![travis](https://img.shields.io/travis/adrai/node-viewmodel.svg)](https://travis-ci.org/adrai/node-viewmodel) [![npm](https://img.shields.io/npm/v/viewmodel.svg)](https://npmjs.org/package/viewmodel) | ||
@@ -167,2 +167,2 @@ Node-viewmodel is a node.js module for multiple databases. | ||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN | ||
THE SOFTWARE. | ||
THE SOFTWARE. |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
45074
1027
168
0