All files / src/models probe-results.model.mongodb.js

100% Statements 6/6
100% Branches 3/3
100% Functions 1/1
100% Lines 6/6

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 81x 1x 1x 1x 1x 1x    
module.exports = function (app, options) {
  options.Model = app.db.collection('probe-results', options.dbName)
  options.Model.createIndex({ forecastTime: 1 }, { expireAfterSeconds: options.expireAfter || options.ttl || 6 * 3600 })
  options.Model.createIndex({ geometry: '2dsphere' })
  options.Model.createIndex({ probeId: 1 })
  options.Model.createIndex({ forecastTime: 1, probeId: 1 })
}