我正在使用Parse作爲後端的移動應用程序,並且我對find函數有問題。以下列格式運行查找功能時:解析查詢查找方法返回對象不是數組
var = firstQuery = (new Parse.Query("MyParseObject"))
.find(),
secondQuery = (new Parse.Query("OtherParseObject")).get(id)
// there is only one object that firstQuery can find
Parse.Promise.when(firstQuery, secondQuery)
.then(function (query1res, query2res) {
// query1res should return only one result wrapped in an array,
// instead query1res is an object without a get method
query1res.forEach (function (res) {
// this fails: cannot get .length of undefined
})
// ... do stuff with the returned data
})
有什麼我失蹤?我相信這個曾經工作過,但現在不行。
由於Parse的工作方式,要正確調試這個問題是很困難的,但是他們的文檔概述了這應該返回一個數組,但是它現在還沒有。
感謝您的幫助。