Skip to content

Instantly share code, notes, and snippets.

@hoc081098
Created May 17, 2018 10:07
Show Gist options
  • Save hoc081098/db49d339843cbfab3c1067d1db8aa83d to your computer and use it in GitHub Desktop.
Save hoc081098/db49d339843cbfab3c1067d1db8aa83d to your computer and use it in GitHub Desktop.
const mongoose = require('mongoose')
mongoose.Promise = global.Promise
const schema = new mongoose.Schema({
name: String,
image_path: String,
created_at: {
type: Date,
default: Date.now
}
})
const mongoDb = 'mongodb://localhost:27017/upload-image'
mongoose.connect(mongoDb)
module.exports = mongoose.model('imagemodel', schema)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment