.find()
Last updated
Was this helpful?
Last updated
Was this helpful?
Was this helpful?
Returns
Description
Object
The data object that was sought
Array
Returns the entire database if an id is not passed in find
// All below works
User.find((obj) => obj._id === 1)
User.find({ _id: 1 })
User.find({ username: "lennart" })
User.find(1)
If the id is not passed:
User.find() // [{ _id: 1, username: "lennart" }]