2015-03-31 72 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。

相关问题