3 Comments
User's avatar
⭠ Return to thread
Aniket Prakash's avatar

I was interviewing for intern role. The interviewer asked me to demonstrate my projects. He asked me to do error handling with a project and was allowed to use google. I had to use mongoose for this. I was stuck at the beginning but after sometime I solved the issue. He wanted to know the reason why I was stuck and why I was getting the error. Even after going through the mongoose docs I couldn't figure it out and then he explained me that.

Expand full comment
neoG Camp's avatar

What did he explain?

Expand full comment
Aniket Prakash's avatar

I used findOne for query. He said that the callback err argument returns error if there is error in executing the query and not if the result is null. This is mentioned in docs but I was unable to find.

Expand full comment