2015-03-31 48 views
0

如何隔離解析查詢以便不影響其他查詢?現在我的代碼如下所示:我如何使Parse Queries變得獨特,以便它們不會互相影響?

query.include("thing"); 
query.find({ 
    success: function(results){ 
    //there are results here as expected 
    } 
}) 

query2.doesNotExist("something"); 
query2.find({ 
     success: function(items){ 
     //there are items here as expected 
    } 
}) 


query.exists("key"); 
query.find({ 
    success: function(keys){ 
    //there are no results here but if I reverse the order of the queries . . . 
    } 
}) 

現在,如果我把這些查詢以不同的順序放在最前面的查詢上面,我會得到預期的結果。

query.exists("key"); 
query.find({ 
    success: function(keys){ 
    //there are no results here but if I reverse the order of the queries . . . 
    } 
}) 


query.include("thing"); 
query.find({ 
    success: function(results){ 
    //there are results here as expected 
    } 
}) 

query2.doesNotExist("something"); 
query2.find({ 
     success: function(items){ 
     //there are items here as expected 
    } 
}) 

看起來好像兩個「查詢」的分析查詢相互影響。我該如何解決這個問題,以便每個查詢都不同?

回答

0

經過進一步調查後,它看起來並不像你可以在解析中繼續一個查詢。但是,您可以在同一個表/集合上創建一個新的Parse.Query。

相關問題