You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
paste/models/paste.js

13 lines
369 B
JavaScript

9 years ago
var mongoose = require('mongoose');
9 years ago
var shortid = require('shortid');
9 years ago
var paste = new mongoose.Schema({
9 years ago
_id: { type: String, unique: true, default: shortid.generate },
9 years ago
paste: { type: String },
9 years ago
expiresAt: { type: Date, expires: 0, default: new Date(Date.now() + 1000 * 60 * 60 * 24 * 7) }
9 years ago
}, {
timestamps: true
});
module.exports = mongoose.model('Paste', paste);