使用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
。