mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-02-17 16:08:10 +01:00
backend logic drafted, moving to frontend
This commit is contained in:
parent
4f5ee8b198
commit
610cba4a60
8 changed files with 237 additions and 72 deletions
|
|
@ -1,11 +1,12 @@
|
|||
const mongoose = require('mongoose');
|
||||
const mongoMeili = require('../lib/mongoMeili');
|
||||
const mongoMeili = require('../lib/db/mongoMeili');
|
||||
|
||||
const messageSchema = mongoose.Schema({
|
||||
messageId: {
|
||||
type: String,
|
||||
unique: true,
|
||||
required: true,
|
||||
index: true,
|
||||
meiliIndex: true
|
||||
},
|
||||
conversationId: {
|
||||
|
|
@ -55,9 +56,10 @@ const messageSchema = mongoose.Schema({
|
|||
}, { timestamps: true });
|
||||
|
||||
messageSchema.plugin(mongoMeili, {
|
||||
host: 'http://localhost:7700',
|
||||
apiKey: 'MASTER_KEY',
|
||||
indexName: 'messages' // Will get created automatically if it doesn't exist already
|
||||
host: process.env.MEILI_HOST,
|
||||
apiKey: process.env.MEILI_KEY,
|
||||
indexName: 'messages', // Will get created automatically if it doesn't exist already
|
||||
primaryKey: 'messageId',
|
||||
});
|
||||
|
||||
const Message = mongoose.models.Message || mongoose.model('Message', messageSchema);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue