labring / FastGPT

FastGPT is a knowledge-based platform built on the LLMs, offers a comprehensive suite of out-of-the-box capabilities such as data processing, RAG retrieval, and visual AI workflow orchestration, letting you easily develop and deploy complex question-answering systems without the need for extensive setup or configuration.
https://tryfastgpt.ai
Other
17.01k stars 4.55k forks source link

MongoDB 无法正常查询 #2760

Closed jhfuture closed 3 hours ago

jhfuture commented 4 hours ago

例行检查

你的版本

问题描述, 日志截图 使用Navicat手动添加记录,但是使用 MongoTeamMember.findOne 无法找到手动插入的记录,但系统自动创建的唯一一条记录则能正常查询出来,在Navicat中执行插入语句则正常。 复现步骤 具体函数为 async function getTeamMember(match: Record<string, any>): Promise<TeamTmbItemType> 文件路径为packages/service/support/user/team/controller.ts 例如我使用以下代码


const tmb = (await MongoTeamMember.findOne({
    userId: "66e42360713983b81d00fad1"
  }))
如果id为默认的,则能正常查询,如果id为手动插入则无法查出

**预期结果**

**相关截图**
![image](https://github.com/user-attachments/assets/69c05dd1-4dab-426f-b1c1-510d80c26f6e)
jhfuture commented 3 hours ago

可以通过修改TeamMemberSchema 文件中的

  userId: {
    // type: Schema.Types.ObjectId,
    // ref: userCollectionName,
    type: String ,
    required: true
  },

进行解决