Answer the question
In order to leave comments, you need to log in
ES6 class method?
The crux of the problem is this.
Class a {
constructor() {}
getCollection() {
let collection = db.collection('users').find((err,users)=>{
return users
})
return collection
}
}
Answer the question
In order to leave comments, you need to log in
Thus, don’t do a return, instead do the actions that you will do with collections right away in find, as soon as it works like that, and perform your actions
Maybe your collection is empty because
return usersreturns undefined?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question