Comparing version 1.0.6 to 2.0.0
@@ -32,7 +32,7 @@ /** | ||
Promise.all([ | ||
this.collection.ensureIndex({domain: 1, minute: 1}, {unique: true, background: true}), | ||
this.collection.ensureIndex({domain: 1, updated: 1}, {background: true}), | ||
this.collection.ensureIndex({minute: 1}, {background: true, expireAfterSeconds: period}), | ||
this.collection.ensureIndex({domain: 1}, {background: true}), | ||
this.collection.ensureIndex({updated: 1}, {background: true}) | ||
this.collection.createIndex({domain: 1, minute: 1}, {unique: true, background: true}), | ||
this.collection.createIndex({domain: 1, updated: 1}, {background: true}), | ||
this.collection.createIndex({minute: 1}, {background: true, expireAfterSeconds: period}), | ||
this.collection.createIndex({domain: 1}, {background: true}), | ||
this.collection.createIndex({updated: 1}, {background: true}) | ||
]).then(res => { | ||
@@ -168,3 +168,3 @@ this.start(interval); | ||
this.collection.update(where, upsertData, {upsert: true}, function() { | ||
this.collection.updateOne(where, upsertData, {upsert: true}, function() { | ||
// console.log(arguments); | ||
@@ -171,0 +171,0 @@ }); |
{ | ||
"name": "nodestat2", | ||
"version": "1.0.6", | ||
"version": "2.0.0", | ||
"description": "nodestat", | ||
@@ -22,4 +22,4 @@ "main": "nodestat.js", | ||
"express": "^4.15.3", | ||
"mongodb": "^2.2.28" | ||
"mongodb": "~3.5.7" | ||
} | ||
} |
17
test.js
@@ -8,15 +8,16 @@ let config = require('./config'); | ||
app.get('/', (req, res) => { | ||
res.send('Hello, Nodestat'); | ||
res.send('Hello, Nodestat'); | ||
}); | ||
MongoClient.connect('mongodb://localhost:27017/viboom', (err, db) => { | ||
MongoClient.connect(`mongodb://localhost:27017`, {useUnifiedTopology: true}) | ||
.then(conn => { | ||
config.app = app; | ||
config.mongoClient = conn.db(config.database); | ||
config.app = app; | ||
config.mongoClient = db; | ||
nodestat.init(config); | ||
}) | ||
.catch(err => { | ||
console.log(err); | ||
}); | ||
app.listen(3000); | ||
console.log('http://localhost:3000'); | ||
app.listen(3000, () => console.log('http://localhost:3000')); |
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
25369
7
308
0