mirror of
https://github.com/labring/FastGPT.git
synced 2025-10-15 15:41:05 +00:00
fix: version schema ref error (#5518)
This commit is contained in:
@@ -21,6 +21,7 @@ description: 'FastGPT V4.12.2 更新说明'
|
||||
4. 用户同步可能出现写冲突问题。
|
||||
5. 无法完全关闭系统套餐,会存在空对象默认值,导致鉴权异常。
|
||||
6. 工作流,添加团队应用,搜索无效。
|
||||
7. 应用版本,ref 字段错误,导致无法正常使用。
|
||||
|
||||
## 🔨 工具更新
|
||||
|
||||
|
@@ -104,7 +104,7 @@
|
||||
"document/content/docs/upgrading/4-11/4111.mdx": "2025-08-07T22:49:09+08:00",
|
||||
"document/content/docs/upgrading/4-12/4120.mdx": "2025-08-12T22:45:19+08:00",
|
||||
"document/content/docs/upgrading/4-12/4121.mdx": "2025-08-15T22:53:06+08:00",
|
||||
"document/content/docs/upgrading/4-12/4122.mdx": "2025-08-22T09:38:44+08:00",
|
||||
"document/content/docs/upgrading/4-12/4122.mdx": "2025-08-22T10:18:24+08:00",
|
||||
"document/content/docs/upgrading/4-8/40.mdx": "2025-08-02T19:38:37+08:00",
|
||||
"document/content/docs/upgrading/4-8/41.mdx": "2025-08-02T19:38:37+08:00",
|
||||
"document/content/docs/upgrading/4-8/42.mdx": "2025-08-02T19:38:37+08:00",
|
||||
|
@@ -1,7 +1,7 @@
|
||||
import { connectionMongo, getMongoModel, type Model } from '../../../common/mongo';
|
||||
const { Schema, model, models } = connectionMongo;
|
||||
import { connectionMongo, getMongoModel } from '../../../common/mongo';
|
||||
const { Schema } = connectionMongo;
|
||||
import { type AppVersionSchemaType } from '@fastgpt/global/core/app/version';
|
||||
import { chatConfigType } from '../schema';
|
||||
import { AppCollectionName, chatConfigType } from '../schema';
|
||||
import { TeamMemberCollectionName } from '@fastgpt/global/support/user/team/constant';
|
||||
|
||||
export const AppVersionCollectionName = 'app_versions';
|
||||
@@ -15,7 +15,7 @@ const AppVersionSchema = new Schema(
|
||||
},
|
||||
appId: {
|
||||
type: Schema.Types.ObjectId,
|
||||
ref: AppVersionCollectionName,
|
||||
ref: AppCollectionName,
|
||||
required: true
|
||||
},
|
||||
time: {
|
||||
@@ -41,11 +41,7 @@ const AppVersionSchema = new Schema(
|
||||
}
|
||||
);
|
||||
|
||||
try {
|
||||
AppVersionSchema.index({ appId: 1, time: -1 });
|
||||
} catch (error) {
|
||||
console.log(error);
|
||||
}
|
||||
AppVersionSchema.index({ appId: 1, _id: -1 });
|
||||
|
||||
export const MongoAppVersion = getMongoModel<AppVersionSchemaType>(
|
||||
AppVersionCollectionName,
|
||||
|
@@ -34,7 +34,7 @@ async function handler(
|
||||
(async () => {
|
||||
const versions = await MongoAppVersion.find(match)
|
||||
.sort({
|
||||
time: -1
|
||||
_id: -1
|
||||
})
|
||||
.skip(offset)
|
||||
.limit(pageSize)
|
||||
|
Reference in New Issue
Block a user