Mongodb - bad query: BadValue unknown top level operator: $gte

后端 未结 3 1048
旧时难觅i
旧时难觅i 2021-01-01 15:30

What is wrong with this query? I tried to run it on mongodb server and received an error as following - \"exception: bad query: BadValue unknown top level operator: $gte\".

3条回答
  •  感情败类
    2021-01-01 16:15

    You need to include explicitly package in cmd prompt like npm i regex and change in service like as below:

    const kidDetails = await this.studentModel.find({ name:{$regex: new RegExp('.*' + studName, 'i') }} );
    

提交回复
热议问题