我的 Sails.js 应用程序有一个名为“Ideas”的模型,并使用默认的蓝图 REST api,当我转到:http://example.com/ideas/find 时,我可以访问集合的内容。
此外,默认情况下,我还可以限制数据以获得特定标题:http://example.com/ideas/find?title=How看电视
虽然我想做的是显示包含关键字“T”的所有标题的 JSON 数据,但是当我将上面的内容替换为
a) ?title=TV
b) ?q=TV
c) ?query=TV
d) ?where(title : (contains:'TV')
它们都不起作用
如何获取包含包含特定关键字的所有标题的 JSON 输出?
最佳答案
基于documentation , where 示例应该有效。但它使用大括号而不是圆括号。
?where={"title":{"contains":"TV"}}
关于javascript - Sails.js - 在 url 中包含 'contains' 或查询以获取适当的 JSON 数据,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27436370/