Last active
December 22, 2016 14:11
-
-
Save ianaya89/f6a2d6156be6749a8eb9a9b4d33d4b3e to your computer and use it in GitHub Desktop.
This file contains hidden or 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
// crea un schema | |
const catSchema = mongoose.Schema({ | |
name: String | |
}); | |
// crea un modelo basado en el schema | |
const Cat = mongoose.model('Cat', catSchema); | |
// creo una instancia del modelo | |
const garfield = new Cat({ name: 'Garfield' }); | |
console.log(garfield.name); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment