0
我在我的應用程序的結構如下:Parse.com:在化合物query.or()包括嵌套指針
Messages -> receiver-> User (User.username)
sender -> User (User.username)
其中 - >表示的指針。我想要將當前用戶發送給的所有消息發送給他們預期的Receiver。並且由 當前用戶接收以創建對話摘要。
問題是,接收方用戶名始終是空的在查詢上,而發送者用戶名是罰款。 如何獲取接收器的用戶名?
var Receiver = new Parse.User();
Receiver.id = 'XXXXXX'; // the problem seems to be here, why???
// Query messages sent by current user
var senderQuery = new Parse.Query(MyParseMessage);
senderQuery.equalTo("receiver", Receiver);
senderQuery.equalTo("sender", Parse.User.current());
// Query messages sent by other user
var receiverQuery = new Parse.Query(MyParseMessage);
receiverQuery.equalTo("receiver", Parse.User.current());
receiverQuery.equalTo("sender", Receiver);
// Combined Query with OR condition
var messageQuery = Parse.Query.or(senderQuery, receiverQuery);
// this should include the receiver data
receiverQuery.include('receiver'); // this is not working, why is not working?
messageQuery.find();
我在想什麼?謝謝!
JavaScript沒有[指針](HTTPS: //en.wikipedia.org/wiki/Pointer_%28programming%29)。你真的在使用哪種語言?或者,你能否改寫爲不要在編程中使用具有明確定義的詞語,但是你使用的意思是別的嗎? –
這是Parse.com中的一個指針,謝謝你的回答。 – lito