mirror of
https://github.com/danny-avila/LibreChat.git
synced 2026-01-20 01:06:11 +01:00
10 lines
344 B
TypeScript
10 lines
344 B
TypeScript
|
|
import messageSchema from '~/schema/message';
|
||
|
|
import type * as t from '~/types';
|
||
|
|
|
||
|
|
/**
|
||
|
|
* Creates or returns the Message model using the provided mongoose instance and schema
|
||
|
|
*/
|
||
|
|
export function createMessageModel(mongoose: typeof import('mongoose')) {
|
||
|
|
return mongoose.models.Message || mongoose.model<t.IMessage>('Message', messageSchema);
|
||
|
|
}
|