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

16 lines
435 B
JavaScript

const mongoose = require('mongoose');
const { customAlphabet } = require('nanoid');
const dictionary = require('nanoid-dictionary');
const nanoid = customAlphabet(dictionary.nolookalikes, 8);
9 years ago
const paste = new mongoose.Schema({
_id: { type: String, default: nanoid },
9 years ago
paste: { type: String },
ip: { type: String },
expiresAt: { type: Date, expires: 0 }
9 years ago
}, {
timestamps: true
});
module.exports = mongoose.model('Paste', paste);