ERR: findById is not a function in mongodb

Viewed 11
`async ViewOne(id: string) {
    const data=await this.database.db().collection('categories').findById('id');
    console.log(data);
    return await data;
  }`

Error: [Nest] 7908 - 09/12/2022, 11:18:44 AM ERROR [ExceptionsHandler] this.database.db(...).collection(...).findById is not a function

0 Answers
Related