These are chat archives for Automattic/mongoose

5th
May 2016
Blake Kostner
@btkostner
May 05 2016 00:37
So with the 5.0 release, will internal logic be moved to promises? and will things like asynchronous toObject() functions work?
Ross Squires
@rossimo
May 05 2016 15:10
hey! question about find queries. is there a way i can query a collection, sort it, and then only retreive the documents first encountered that have a specific unique member?
LeonineKing1199
@LeonineKing1199
May 05 2016 15:13
What kind of a specific unique number?
You might be able to just incorporate that number searching into the query.
for example
i’d like to sort by date, and only retreive the documents with unique users
ex: only return the first and third document
LeonineKing1199
@LeonineKing1199
May 05 2016 15:19
Man, that sounds tough to do with just pure DB queries...
Ross Squires
@rossimo
May 05 2016 15:19
there’s go to be a way
i found distinct(), but that’s not quite what i want
This message was deleted
may aggregate() somehow
Pier-Luc Gagnon
@Nepoxx
May 05 2016 15:40
isn't that a great map/reduce use case?
Ross Squires
@rossimo
May 05 2016 15:41
i hope
will check out those docs
Pier-Luc Gagnon
@Nepoxx
May 05 2016 15:48
you can sort in the map phase, and remove duplicates in the reduce phase
Ross Squires
@rossimo
May 05 2016 15:49
thanks @Nepoxx ! reading the docs now