UNPKG

@dreesq/serpent

Version:

An express wrapper for developing fast web applications

40 lines (38 loc) 645 B
const mongoose = require('mongoose'); const Schema = mongoose.Schema; /** * Token model */ module.exports = new Schema({ userId: { type: Schema.ObjectId, ref: 'User', index: true }, token: { type: String, index: true }, guid: { type: String, index: true }, type: { type: String, index: true, required: true }, extra: { type: Object }, description: { type: String }, createdAt: { type: Date, required: true, default() { return new Date(); } } });