hkirat / todo-app

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

todo.updateOne()

thinley4 opened this issue · comments

In backend/index.js

Code:

await todo.updateOne

instead of

await todo.update

we can use update because _id is unique for every document so this will update only that document

await todo.updateOne() works for me

While using await todo.update(), it throws error that await todo.update() is not a function.

await todo.updateOne() works for me

While using await todo.update(), it throws error that await todo.update() is not a function.

Correct ✅

Thank you @thinley4 , the solution works for me.