本文介绍了Parse.com查询限制-影响关键限制在哪里?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我了解解析时存在PFQuery限制,您一次只能检索1000个对象.我认为不是,但这是否也限制了可以执行whereKey比较的次数.例如

I understand that with parse there is a PFQuery limit where you can only retrieve 1000 objects at a time. I presume it doesn't, but does this also limit the number of whereKey comparisons that can be carried out. E.g.

var query = PFQuery(classname: "Photos")
query.whereKey("Name", equalTo: someString)
query.findObjectsInBackgroundWithBlock()

如果类中有超过1000个对象,whereKey比较在比较了1000个对象之后会停止,还是仅实际检索超过1000个对象的问题?

If there are more than 1000 objects in the class, will the whereKey comparison stop after it has compared 1000 objects, or is the issue with only actually retrieving more than 1000 objects?

我认为对此没有限制的原因是,如果您有1000个以上的用户,那么将没有直接进行标准用户查询的方法.

The reason I presume there is not a limit on this, is that If you have more than 1000 users, there would be no straight forward way to do a standard user query.

推荐答案

  • 使用whereKey参数不会影响您的提取限制,实际上,仅由于其用途这一事实,它就减少了它们.包含密钥的目的是缩小范围正确吗?您甚至可以在同一查询中包含多个键或whereKey语句.因此,通过进一步缩小范围,可以减少要获取的可能对象.简而言之,您的推定是正确的.

    • Using the whereKey parameters does not effect your fetch limits, in fact, it reduces them simply due to the fact of its purpose. The point of including keys is to narrow it down correct? You can even include multiple keys or whereKey statements in the same query. So by narrowing it down further your reduce the probable objects to be fetched. So in short, your presumption is correct.

      首先要弄清楚,Key实际上并没有执行任何操作,它设置了一个过滤器[parameter]并将其应用于给定块的异步调用,以使用这些键进行某些操作. findObjects会返回您现在知道的限制1000.您可以跳过查询请参见此处,这实际上意味着您可以查询前1000个,并在准备显示更多结果时跳过已查询的内容[分页].因此,要回答第二个问题,whereKey参数不会停止执行任何操作,因为它无论如何都不会停止,也不会停止检索对象,您只需要学习如何在返回的前1000个对象中导航即可.

      Lets be clear firstly, whereKey isn't actually doing anything, its setting a filter [parameter] and applying it to your asynchronous calls for the given blocks to do something with those keys. The findObjects is what returns your limit that you now know is 1000. You can skip queries See Here which effectively means you can query for the first 1000 and skip those you've already queried once your ready to display further results [pagination]. So to answer your second question, whereKey parameter won't stop doing anything, because it kind of isn't anyways, nor will you stop retrieving objects, you just have to learn how to navigate around your first 1000 returned objects.

      这篇关于Parse.com查询限制-影响关键限制在哪里?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-05 04:00