Guest User

Untitled

a guest
May 22nd, 2018
93
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.35 KB | None | 0 0
  1. const mongoose = require('mongoose')
  2. mongoose.Promise = global.Promise
  3.  
  4. const schema = new mongoose.Schema({
  5. name: String,
  6. image_path: String,
  7. created_at: {
  8. type: Date,
  9. default: Date.now
  10. }
  11. })
  12.  
  13. const mongoDb = 'mongodb://localhost:27017/upload-image'
  14. mongoose.connect(mongoDb)
  15.  
  16. module.exports = mongoose.model('imagemodel', schema)
Add Comment
Please, Sign In to add comment