mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-22 12:20:34 +00:00

* feat: log store * fix: full text search match query * perf: mongo schema import, Avoid duplicate import
41 lines
877 B
TypeScript
41 lines
877 B
TypeScript
import { connectionMongo, getMongoModel, type Model } from '../../../common/mongo';
|
|
const { Schema, model, models } = connectionMongo;
|
|
import { AppVersionSchemaType } from '@fastgpt/global/core/app/version';
|
|
import { chatConfigType } from '../schema';
|
|
|
|
export const AppVersionCollectionName = 'app_versions';
|
|
|
|
const AppVersionSchema = new Schema({
|
|
appId: {
|
|
type: Schema.Types.ObjectId,
|
|
ref: AppVersionCollectionName,
|
|
required: true
|
|
},
|
|
time: {
|
|
type: Date,
|
|
default: () => new Date()
|
|
},
|
|
nodes: {
|
|
type: Array,
|
|
default: []
|
|
},
|
|
edges: {
|
|
type: Array,
|
|
default: []
|
|
},
|
|
chatConfig: {
|
|
type: chatConfigType
|
|
}
|
|
});
|
|
|
|
try {
|
|
AppVersionSchema.index({ appId: 1, time: -1 });
|
|
} catch (error) {
|
|
console.log(error);
|
|
}
|
|
|
|
export const MongoAppVersion = getMongoModel<AppVersionSchemaType>(
|
|
AppVersionCollectionName,
|
|
AppVersionSchema
|
|
);
|