Last active
March 25, 2019 21:37
-
-
Save lamecksilva/519cd2a6c0adb7a3b346edc03e7d95c1 to your computer and use it in GitHub Desktop.
Model para o tutorial do medium
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const mongoose = require('mongoose'); | |
const { Schema } = mongoose; | |
const carroSchema = new Schema({ | |
marca: { | |
type: String, | |
required: true | |
}, | |
modelo: { | |
type: String, | |
require: true | |
}, | |
criadoEm: { | |
type: Date, | |
default: Date.now | |
} | |
}); | |
module.exports = mongoose.model('carros', carroSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment