MongoDB via Mongoose JS - What is findByID?

后端 未结 4 1259
野趣味
野趣味 2020-12-04 13:01

I am writing a NodeJS server with ExpressJS, PassportJS, MongoDB and MongooseJS. I just managed to get PassportJS to use user data obtained via Mongoose to authenticate.

4条回答
  •  日久生厌
    2020-12-04 13:42

    As opposed to find() which can return 1 or more documents, findById() can only return 0 or 1 document. Document(s) can be thought of as record(s).

提交回复
热议问题