mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 20:37:48 +00:00
4.8.6 fix (#1963)
* feat: log store * fix: full text search match query * perf: mongo schema import, Avoid duplicate import
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
import { connectionMongo, type Model } from '../../common/mongo';
|
||||
import { connectionMongo, getMongoModel, type Model } from '../../common/mongo';
|
||||
const { Schema, model, models } = connectionMongo;
|
||||
import { ChatItemSchema as ChatItemType } from '@fastgpt/global/core/chat/type';
|
||||
import { ChatRoleMap } from '@fastgpt/global/core/chat/constants';
|
||||
@@ -9,7 +9,6 @@ import {
|
||||
} from '@fastgpt/global/support/user/team/constant';
|
||||
import { AppCollectionName } from '../app/schema';
|
||||
import { userCollectionName } from '../../support/user/schema';
|
||||
import { NodeOutputKeyEnum } from '@fastgpt/global/core/workflow/constants';
|
||||
import { DispatchNodeResponseKeyEnum } from '@fastgpt/global/core/workflow/runtime/constants';
|
||||
|
||||
export const ChatItemCollectionName = 'chatitems';
|
||||
@@ -99,7 +98,4 @@ try {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
export const MongoChatItem: Model<ChatItemType> =
|
||||
models[ChatItemCollectionName] || model(ChatItemCollectionName, ChatItemSchema);
|
||||
|
||||
MongoChatItem.syncIndexes();
|
||||
export const MongoChatItem = getMongoModel<ChatItemType>(ChatItemCollectionName, ChatItemSchema);
|
||||
|
@@ -1,4 +1,4 @@
|
||||
import { connectionMongo, type Model } from '../../common/mongo';
|
||||
import { connectionMongo, getMongoModel, type Model } from '../../common/mongo';
|
||||
const { Schema, model, models } = connectionMongo;
|
||||
import { ChatSchema as ChatType } from '@fastgpt/global/core/chat/type.d';
|
||||
import { ChatSourceMap } from '@fastgpt/global/core/chat/constants';
|
||||
@@ -98,6 +98,4 @@ try {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
export const MongoChat: Model<ChatType> =
|
||||
models[chatCollectionName] || model(chatCollectionName, ChatSchema);
|
||||
MongoChat.syncIndexes();
|
||||
export const MongoChat = getMongoModel<ChatType>(chatCollectionName, ChatSchema);
|
||||
|
@@ -1,5 +1,5 @@
|
||||
import { AppCollectionName } from '../../app/schema';
|
||||
import { connectionMongo, type Model } from '../../../common/mongo';
|
||||
import { connectionMongo, getMongoModel, type Model } from '../../../common/mongo';
|
||||
const { Schema, model, models } = connectionMongo;
|
||||
import type { ChatInputGuideSchemaType } from '@fastgpt/global/core/chat/inputGuide/type.d';
|
||||
|
||||
@@ -23,7 +23,7 @@ try {
|
||||
console.log(error);
|
||||
}
|
||||
|
||||
export const MongoChatInputGuide: Model<ChatInputGuideSchemaType> =
|
||||
models[ChatInputGuideCollectionName] || model(ChatInputGuideCollectionName, ChatInputGuideSchema);
|
||||
|
||||
MongoChatInputGuide.syncIndexes();
|
||||
export const MongoChatInputGuide = getMongoModel<ChatInputGuideSchemaType>(
|
||||
ChatInputGuideCollectionName,
|
||||
ChatInputGuideSchema
|
||||
);
|
||||
|
Reference in New Issue
Block a user