Mongoose query a populated field

后端 未结 1 815
傲寒
傲寒 2020-12-18 22:02
   db.History.find({\'_file.project\': \'someproject\' )
      .populate(\'_file\', \'name reference project\')
      .sort(sortField || \'-created\')
      .limit(m         


        
相关标签:
1条回答
  • 2020-12-18 22:55

    No, a find query's conditions parameter can only reference the collection being queried.

    populate is not a join, it's just a convenience function to follow up the main query with additional queries to pull in the associated data from other collections.

    0 讨论(0)
提交回复
热议问题