dyno-bot/Dyno-datafactory-develop/models/Cache.js

14 lines
396 B
JavaScript
Raw Permalink Normal View History

2020-09-12 20:08:48 +02:00
'use strict';
const mongoose = require('mongoose');
const Schema = mongoose.Schema;
const cacheSchema = new Schema({
key: { type: String, unique: true },
data: { type: Schema.Types.Mixed },
createdAt: { type: Date, default: Date.now, expires: '72h' },
accessedAt: { type: Date, default: Date.now, expires: '24h' },
});
module.exports = { name: 'Cache', schema: cacheSchema }