Timeline for Node js / Mongoose .find()
Current License: CC BY-SA 3.0
6 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
May 25, 2018 at 6:49 | comment | added | darshan a n | @DavidAlsh Please look into above comment. | |
May 24, 2018 at 23:56 | comment | added | David Alsh |
@darshanan do you mean how do you search through values in nested keys on a document? If so it's db.collections.find({"keyOne.keyTwo":"search"})
|
|
Jan 16, 2018 at 1:01 | comment | added | David Alsh | Thank you, an alternative to .find() is .findOne() - .find() returns and array, while .findOne() returns the first record it finds(object), ignoring the rest. This is good in cases where you are looking up documents with a unique field - like by email, or ID. | |
Jan 15, 2018 at 17:48 | vote | accept | Echo | ||
Jan 15, 2018 at 7:27 | comment | added | Joseph Chambers | I think you gave the best answer. I was going to jump in but; you created a lot of value here. Good answer. | |
Jan 15, 2018 at 6:33 | history | answered | David Alsh | CC BY-SA 3.0 |