gpt4 book ai didi

javascript - 查询 Marionette.js 集合

转载 作者:行者123 更新时间:2023-11-28 00:53:18 24 4
gpt4 key购买 nike

我想对 Marionette Collections 执行相当复杂的过滤。有没有办法使用像 MongoDB API 这样的数据库查询来搜索模型?

示例:

MarionetteCollection.find( 
{
type: 'product',
$or: [ { qty: { $gt: 100 } }, { price: { $lt: 9.95 } } ],
$and [ { active: true} ],
$sortby{'name'},
$order {'asc'}
});

也许是 Marionette.js 的扩展?

最佳答案

Marionette 中没有任何内容可以为您提供帮助,并且 Marionette 不会对常规 Backbone.Collection 进行任何更改/添加。

你可以看看backbone-query 。它似乎可以满足您的要求。

关于javascript - 查询 Marionette.js 集合,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26517870/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com