Download api/models/schema/key.js from Zhitomir/chat: direct link, hf CLI and curl.
- Browser
- Download file 426 Bytes
-
https://huggingface.co/spaces/Zhitomir/chat/resolve/main/api/models/schema/key.js
- Command line
-
hf download hf://spaces/Zhitomir/chat/api/models/schema/key.js
-
curl -L -o key.js https://huggingface.co/spaces/Zhitomir/chat/resolve/main/api/models/schema/key.js
426 Bytes
| const mongoose = require('mongoose'); | |
| const keySchema = mongoose.Schema({ | |
| userId: { | |
| type: mongoose.Schema.Types.ObjectId, | |
| ref: 'User', | |
| required: true, | |
| }, | |
| name: { | |
| type: String, | |
| required: true, | |
| }, | |
| value: { | |
| type: String, | |
| required: true, | |
| }, | |
| expiresAt: { | |
| type: Date, | |
| expires: 0, | |
| }, | |
| }); | |
| keySchema.index({ expiresAt: 1 }, { expireAfterSeconds: 0 }); | |
| module.exports = keySchema; | |