new procurement

This commit is contained in:
2025-10-23 09:49:04 +03:00
parent 99127c42e2
commit a6065dd95c
22 changed files with 1588 additions and 409 deletions

View File

@@ -1,4 +1,4 @@
const mongoose = require('mongoose')
const mongoose = require('mongoose');
const messageSchema = new mongoose.Schema({
threadId: {
@@ -29,9 +29,9 @@ const messageSchema = new mongoose.Schema({
default: Date.now,
index: true
}
})
});
// Индекс для быстрого поиска сообщений потока
messageSchema.index({ threadId: 1, timestamp: -1 })
messageSchema.index({ threadId: 1, timestamp: -1 });
module.exports = mongoose.model('Message', messageSchema)
module.exports = mongoose.model('Message', messageSchema);