简体   繁体   English

解析API请求

[英]Parse API Requests

How are Parse API requests quantified exactly? 如何精确解析Parse API请求?

I'm using Parse for my backend and I have a cloud job that updates all of the objects in my DB every ~5 hours. 我在后端使用Parse,并且有一个云作业可以每隔5个小时更新一次数据库中的所有对象。 it goes through each object and updates the score field. 它遍历每个对象并更新score字段。

On the front end, when users hit a page, the client requests 9 objects from parse, then get is called on each object several times to get the various fields within each object. 在前端,当用户打一个网页,客户端请求从parse 9点的对象,那么get调用的每个对象多次获得每个对象中的各个领域。

For example, query.find() will return a photo object. 例如, query.find()将返回照片对象。 I call photo.get('name') , photo.get('size') , etc.. 我叫photo.get('name')photo.get('size')等。

I've looked online and haven't been able to find a clearcut answer on what is considered an api request with Parse. 我在网上看了一下,还没有找到关于Parse的api请求的明确答案。 Any help? 有什么帮助吗?

Thanks 谢谢

When you query multiple objects in one query this will just use one API request. 当您在一个查询中查询多个对象时,这将仅使用一个API请求。 Calling get on the objects that are returned won't use any extra API requests because these objects and their values all will be stored in memory. 在返回的对象上调用get不会使用任何额外的API请求,因为这些对象及其值都将存储在内存中。 However, if you were to save each of these objects, even if you used the saveAll feature, you will use one API request per object saved. 但是,如果要保存每个对象,即使使用了saveAll功能,每个保存的对象也将使用一个API请求。 Furthermore, anytime you call a cloud function you are using an API request just to call that cloud function. 此外,无论何时调用云函数,您都在使用API​​请求只是为了调用该云函数。 So if you run a cloud function where you query lots of objects and then update these objects, you will use one API call for the cloud function, one API call for the query, and as many API calls as objects you query. 因此,如果您运行一个查询许多对象然后更新这些对象的云函数,则将对云函数使用一个API调用,对查询使用一个API调用,并使用与查询对象一样多的API调用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM