diff --git a/package.json b/package.json index 7d6a992..85349d9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "shrimp-server", - "version": "0.6.7", + "version": "0.6.8", "description": "Shrimp 框架后端 — 声明式字段驱动的 Node.js 管理后台框架(Express + Mongoose + JWT)", "main": "dist/main/index.js", "types": "dist/main/index.d.ts", diff --git a/src/Shrimp/ShrimpTableModule.ts b/src/Shrimp/ShrimpTableModule.ts index 0dad6ef..642a101 100644 --- a/src/Shrimp/ShrimpTableModule.ts +++ b/src/Shrimp/ShrimpTableModule.ts @@ -300,6 +300,11 @@ export class ShrimpTableModule = ITableCrudProto const stringLikeTypes = new Set(['string', 'textarea']) const where: Record = {} for (const [key, value] of Object.entries(filter)) { + // _id 始终放行精确过滤(单项查看/relation 跳转用),无需配 filterable + if (key === '_id') { + if (value != null && value !== '') where['_id'] = { eq: value } + continue + } const field = filterableFields.get(key) if (!field) continue if (value == null) continue