Answers for "loop through mongoose.all()"

0

loop through mongoose.all()

const queryAllUsers = () => {
    //Where User is you mongoose user model
    User.find({} , (err, users) => {
        if(err) //do something...

        users.map(user => {
            //Do somethign with the user
        })
    })
}
Posted by: Guest on June-29-2021

Browse Popular Code Answers by Language