如何获取基于相关集合的记录集,仅限于填充独占条件?

时间:2017-02-13 17:22:44

标签: sails.js waterline

使用Waterline(和Sails.js)如何查询多对多关联的结果,仅限于匹配整个标准集?

Room.find({type:"1to1"}).populate('participants', { id: [ 1, 2] }).
then((rooms)=>{
   // rooms array of records should only contain room records
   // that have both participants with an id of 1 and 2,
   // but not rooms with only one participant 1 or 2
}) 

我正在寻找的结果只包含同时具有指定用户的rooms

0 个答案:

没有答案