Last active
October 24, 2018 07:26
-
-
Save mflisikowski/ca8945de0cae3d7047276e9f833bcb81 to your computer and use it in GitHub Desktop.
mongoose examples
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
import mongoose, { Schema } from 'mongoose' | |
const userSchema = new Schema({ | |
loginInfo: { | |
providerID: { | |
type: String | |
}, | |
providerKey: { | |
type: String | |
} | |
}, | |
firstName: { | |
type: String | |
}, | |
lastName: { | |
type: String | |
}, | |
fullName: { | |
type: String | |
}, | |
email: { | |
type: String | |
}, | |
password: { | |
type: String | |
}, | |
salt: { | |
type: String | |
}, | |
settings: { | |
preferredLang: { | |
type: String | |
}, | |
isReceiveNotification: { | |
type: Boolean | |
}, | |
isReceiveEmail: { | |
type: Boolean | |
}, | |
}, | |
roles: { | |
type: Array | |
}, | |
status: { | |
type: String | |
}, | |
meta: { | |
_member: { | |
type: String | |
}, | |
_version: { | |
type: Number | |
}, | |
_created_by: { | |
type: String | |
}, | |
_created: { | |
type: Date | |
}, | |
_last_modified: { | |
type: Date | |
}, | |
_owner: { | |
type: String | |
}, | |
_modified_by: { | |
type: String | |
}, | |
} | |
}) | |
module.exports = mongoose.model('User', userSchema) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment