dyno-bot/Dyno-datafactory-develop/models/Cache.js
2020-09-12 19:08:48 +01:00

14 lines
396 B
JavaScript

'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 }