我正尝试在https://github.com/CollectionFS/Meteor-http-publish上使用https://github.com/CollectionFS/Meteor-http-publish包。虽然我已经使用了GET - /api/list
功能,但我不知道如何获得一个文档:
(GET - /api/list/:id - find one published document).
有人可以提供一个卷曲的例子,假设一定的反对意见。例如:{a:3, b:2}
,{a:4, b:3}
,并要求使用{a:3}
获取对象。
谢谢。
发布于 2014-12-20 15:47:56
您需要将其放入查询函数中。
HTTP.publish({collection: myList},function( ){
return myList.find(this.query);
});
this.query包含与请求一起发送的数据。
curl http://localhost:3000/api/myList?a=3
我对芒果的了解还不够,无法知道这是否是潜在的安全风险,如果有人能对此发表评论,请这样做。
https://stackoverflow.com/questions/27170438
复制相似问题