Created
January 10, 2017 13:09
-
-
Save shankie-codes/38d8e788eac15209b11c5e62c623e749 to your computer and use it in GitHub Desktop.
A Sublime Text snippet for creating Mongoose.js models
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
<snippet> | |
<content><![CDATA[ | |
import mongoose from 'mongoose'; | |
const Schema = mongoose.Schema; | |
const ${1:${TM_FILENAME/(.+)\..+|.*/$1/:SchemaName}}Schema = new Schema({ | |
name: { type: 'String', required: true } | |
}); | |
export default mongoose.model('${1:SchemaName}', ${1:SchemaName}Schema); | |
]]></content> | |
<tabTrigger>mmdl</tabTrigger> | |
<scope>source.js -(meta)</scope> | |
<description>Mongoose: model definition</description> | |
</snippet> | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment