1
獲得通過陣列PARAMS模型我有這樣一個模型:如何從集合
model =
from: "[email protected]"
id: 1
to: [[email protected]]
,我必須含有這些類型的模型的集合。該集合需要過濾from
。我知道_.where
和underscore.js
函數。我使用這樣的:
fromIds = _.pluck _.where(msgs, from : login), 'msgId'
,需要過濾由「到」還有:
toIds = _.pluck _.where(msgs, to : login), 'msgId'
這是行不通的,因爲to
是一個數組。我如何過濾to
?如果有人幫助我,我將不勝感激!