findall() function in mongodb?


I have a login collection with phone number, password. A user has two accounts with the same phone number and password. Check the following. I want to find all the details of the user.'/authenticate', function(req, res) {
    staffModel.find({},{'mobile':},function(err, user) {

            if (err) {
                return console.log(err);

In the above example, find was not working, where as following was working. Why? And i want to get all the documents, not a single document.

 staffModel.findOne({'mobile':},function(err, user) {

Show source
| find   | node.js   | mongoose   | mongodb   2017-10-23 13:10 0 Answers

Answers to findall() function in mongodb? ( 0 )

Leave a reply to - findall() function in mongodb?

◀ Go back