mirror of
https://github.com/danny-avila/LibreChat.git
synced 2025-12-17 08:50:15 +01:00
feat: reorganize api files, add mongoMeili
This commit is contained in:
parent
854f1c3572
commit
9995a159aa
15 changed files with 200 additions and 45 deletions
|
|
@ -1,13 +1,12 @@
|
|||
const mongoose = require('mongoose');
|
||||
// const mongomeili = require('mongomeili');
|
||||
const MeiliSearch = require('meilisearch');
|
||||
const _ = require('lodash');
|
||||
const mongoMeili = require('../lib/mongoMeili');
|
||||
|
||||
const messageSchema = mongoose.Schema({
|
||||
messageId: {
|
||||
type: String,
|
||||
unique: true,
|
||||
required: true
|
||||
required: true,
|
||||
meiliIndex: true
|
||||
},
|
||||
conversationId: {
|
||||
type: String,
|
||||
|
|
@ -55,11 +54,11 @@ 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
|
||||
// });
|
||||
messageSchema.plugin(mongoMeili, {
|
||||
host: 'http://localhost:7700',
|
||||
apiKey: 'MASTER_KEY',
|
||||
indexName: 'messages' // Will get created automatically if it doesn't exist already
|
||||
});
|
||||
|
||||
const Message = mongoose.models.Message || mongoose.model('Message', messageSchema);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue