These are chat archives for Automattic/mongoose

Sep 2016
Sep 08 2016 12:08
@peterbsmith2 try model.findOne({'address.coords.0':-55})
Nicholai Nissen
Sep 08 2016 13:42
Is it possible (and legitimate) to do a query and check if the document exists before continuing with the query?
I'm asking because depending on case I wanna do different things on the document, but I don't want to handle requests on non-existing documents for every case.
I'm thinking in a .then() and then go on with the query
Document = Model.findById(123)
.then(doc => {
    if(!doc) return whatever

    Document.otherQueriesHere() /* like update or whatever */
Sep 08 2016 22:29
@peterbsmith2 i have a project that i want to bring to reality!