使用.where()
或类似函数的主干集合是否接受某种形式的较少/大于语句,例如<=
,>=
,<
,>
我无法在文档中找到任何说明任何内容的内容
答案 0 :(得分:2)
不,where
不支持。来自fine manual:
其中
collection.where(attributes)
返回集合中与传递的属性匹配的所有模型的数组。适用于
filter
的简单案例。
where
只是伪装filter
来电,因此您可以直接使用filter
(mixed into Backbone collections}来处理更复杂的事情:
var matches = collection.filter(function(m) {
/* check model `m` here */
});