mirror of https://github.com/JoeBiellik/paste
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.
13 lines
369 B
JavaScript
13 lines
369 B
JavaScript
var mongoose = require('mongoose');
|
|
var shortid = require('shortid');
|
|
|
|
var paste = new mongoose.Schema({
|
|
_id: { type: String, unique: true, default: shortid.generate },
|
|
paste: { type: String },
|
|
expiresAt: { type: Date, expires: 0, default: new Date(Date.now() + 1000 * 60 * 60 * 24 * 7) }
|
|
}, {
|
|
timestamps: true
|
|
});
|
|
|
|
module.exports = mongoose.model('Paste', paste);
|