Last active
December 22, 2016 14:19
-
-
Save ianaya89/dfde755c30c7cbfc4d510331a8b69ba6 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
const catSchema = mongoose.Schema({ | |
name: String | |
}); | |
catSchema.methods.speak = function () { | |
console.log('Meow', this.name); | |
}; | |
const Cat = mongoose.model('Cat', catSchema); | |
const garfield = new Cat({name: 'garfield'}); | |
garfield.speak(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment