Spaces:
Running
Running
Download models/Pin.js from 4send/messenger: direct link, hf CLI and curl.
- Browser
- Download file 578 Bytes
-
https://huggingface.co/spaces/4send/messenger/resolve/main/models/Pin.js
- Command line
-
hf download hf://spaces/4send/messenger/models/Pin.js
-
curl -L -o Pin.js https://huggingface.co/spaces/4send/messenger/resolve/main/models/Pin.js
578 Bytes
| const mongoose = require('mongoose'); | |
| const PinSchema = new mongoose.Schema({ | |
| message_id: { type: mongoose.Schema.Types.ObjectId, ref: 'Message' }, | |
| chat_id: { type: String, index: true }, | |
| pinner_id: { type: String }, | |
| pin_type: { type: String, enum: ['both', 'me', 'self'], default: 'both' }, | |
| text_preview: { type: String }, | |
| timestamp: { type: Date, default: Date.now } | |
| }); | |
| PinSchema.index({ chat_id: 1, pinner_id: 1 }); | |
| PinSchema.index({ message_id: 1, chat_id: 1, pinner_id: 1 }, { unique: true }); | |
| module.exports = mongoose.model('Pin', PinSchema); | |