我在Parse有两张桌子:Product和Introduction。
Introduction有指针列product和字符串列status__。

我可以使用以下参数轻松地检索所有状态为"live,验证“的介绍,以获得介绍请求(解析文件):
{
where = {
status = {
"$in" = (
live,
validated
);
};
};
}现在,我想检索所有的介绍,例如,所有产品id egal到"Jpun01VJ3c,AkxTvIdZTQ“。
我尝试以下参数(我还尝试在$in中只使用一个$in数组:"$in“= (Jpun01VJ3c,AkxTvIdZTQ);)。
{
where = {
product = {
"$in" = (
{
"__type" = Pointer;
className = Product;
objectId = Jpun01VJ3c;
},
{
"__type" = Pointer;
className = Product;
objectId = AkxTvIdZTQ;
}
);
};
};
}因此,问题是:我们如何用产品列表检索介绍?
你有什么建议吗?
ps :只检索一个特定产品的介绍没有问题,如下所示:
{
where = {
product = {
"__type" = Pointer;
className = Product;
objectId = Jpun01VJ3c;
};
};
}谢谢
发布于 2017-02-02 16:00:23
在这种情况下,您可能希望使用matchesQuery而不是containedIn。
下面的代码是JS,但很容易翻译:
var productQuery = new Parse.Query("Product");
productQuery.containedIn("objectId", [ YOUR LIST OF IDs ]);
var introductionQuery = new ParseQuery("Introduction");
introductionQuery.matchesQuery("product", productQuery);
introductionQuery
.find()
.then(function(introductions) {
[...]
});https://stackoverflow.com/questions/42000698
复制相似问题