ループのためのオブジェクトの参照固有のプロパティ
-
20-12-2019 - |
質問
私の解析クラウドコードにmatchCenterItem
オブジェクトを持っています。それで、このようなもの:
Parse.Cloud.define("MatchCenterTest", function(request, response) {
var matchCenterItem = Parse.Object.extend("matchCenterItem");
for (let i of matchCenterItem) {
console.log(i.categoryId);
console.log(i.minPrice);
}
success: function (httpResponse) {
console.log('It worked!');
response.success('Yay!');
},
error: function (httpResponse) {
console.log('error!!!');
response.error('Request failed');
}
});
.
これは明らかに間違っています、私は正しくこれを達成するために構文を形成する方法はわかりません。
解決
内容を見るにはクラスを照会する必要があります。
Parse.Cloud.define("MatchCenterTest", function(request, response) {
var query = new Parse.Query("MatchCenterTest");
query.limit(10);
query.find().then(function(results) {
for (i=0; i<results.length; i++) {
console.log(results[i].get('categoryId'));
console.log(results[i].get('minPrice'));
}
response.success('Cool');
}, function(error) {
response.error('Uncool');
});
});
. 所属していません StackOverflow