Mongodb : TypeError: Cannot read property 'findById' of undefined

can’t figure out whats wrong

Hello there,

Do you see any other errors in your console? That one is a head-scratcher…your code looks fine.

yes ,


I’m trying to make it work from yesterday
I made another project with same code but same error there

It appears you are redefining the variable Person

You should not use the same variable name for your object, as well as your schema, and the document passed in the callback.

1 Like