These are chat archives for Automattic/mongoose

3rd
Dec 2015
TrejGun
@TrejGun
Dec 03 2015 13:16
Hi there! i have a question about populate function. last example on this page (http://mongoosejs.com/docs/populate.html) says i can deep populate objects but this actually doesn't work, is it a bug or i'm doing something wrong
Luke Childs
@lukechilds
Dec 03 2015 17:00

@vkarpov15 Thanks for the reply but my ids aren't sequential.

I wanted to order by updated date starting from a specific id. As far as I can tell this isn't possible with Mongoose so instead I'm now doing a .where('updated').lt(aDate) to start from the updated date of the specific document:

var query = Post.find()
  .where('status').equals(status)
  .sort('-updated')
  .limit(count);
if(after) {
  query.where('updated').lt(after);
}
James Lee
@uptownhr
Dec 03 2015 22:02
when adding in a new "unique" index into a collection where duplicates already exists, do you have to remove the duplicates before the mongoose schema defined "unique" takes affect? Does adding in "dropDups" help at all in this scenario? Help meaning, I don't have to manually remove the dups.
Christopher Shelley
@basiclaser
Dec 03 2015 22:04
Hi all, im programming a search feature using mongoose/mongo
I have generated a text index which seems to work fine in the mongo cli client
i can successfully query the index with db.the_list.find( { $text: { $search: "as" } } ) - how would i do the same through my mongoose routes? my original mongoose route which collected the whole collection looks like this listModel.find( … , do I just switch ‘find’ for ‘aggregate’ and pass in the query string?