Skip to content

Instantly share code, notes, and snippets.

@vdeturckheim
Last active April 10, 2016 17:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save vdeturckheim/e54d0913ed4d4e9c892fde0cb7b1c7f2 to your computer and use it in GitHub Desktop.
Save vdeturckheim/e54d0913ed4d4e9c892fde0cb7b1c7f2 to your computer and use it in GitHub Desktop.
'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