Advertisement
Guest User

Untitled

a guest
Apr 6th, 2020
175
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // Model
  2. const mongoose = require('mongoose');
  3.  
  4. const ThresholdSchema = new mongoose.Schema({
  5.   thresholdValue: { type: Number, required: true },
  6. });
  7.  
  8. mongoose.model('Threshold', ThresholdSchema);
  9. module.exports = mongoose.model('Threshold');
  10.  
  11. // Seed
  12. module.exports = {
  13.   /**
  14.    * @param {Collection} db db
  15.    */
  16.   up: async (db) => {
  17.     await db.collection('threshold').insert({ thresholdValue: 3.00 });
  18.   },
  19.   down: async (db) => {
  20.     console.log(db);
  21.   },
  22. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement