Last active
April 10, 2016 17:23
-
-
Save vdeturckheim/e54d0913ed4d4e9c892fde0cb7b1c7f2 to your computer and use it in GitHub Desktop.
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
'use strict'; | |
const Mongoose = require('mongoose'); | |
const Schema = Mongoose.Schema; | |
const userSchema = new Schema({ | |
githubid: { | |
type: String, | |
required: true, | |
select: false | |
}, | |
avatar: String, | |
githubToken: { | |
type: String, | |
select: false | |
}, | |
username: { | |
type: String, | |
unique: true | |
}, | |
displayName: { | |
type: String | |
}, | |
email: { | |
type: String, | |
select: false | |
}, | |
description: { | |
type: String | |
}, | |
website: { | |
type: String | |
}, | |
creationDate: { | |
type: Date, | |
default: Date.now, | |
required: true | |
}, | |
lastUpdate: { | |
type: Date, | |
default: Date.now, | |
required: true | |
}, | |
token: { | |
type: String, | |
select: false, | |
unique: true | |
}, // temporary | |
tokenCreation: Date | |
}); | |
module.exports = Mongoose.model('User', userSchema); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment