简体   繁体   English

我是否必须先获取对象才能更新parse.com中的元数据字段

[英]Do I have to fetch the object first in order to update a meta-data field in parse.com

In Parse.com, the help document for updating an object seems to require a query first to retrieve the object before one can update the meta data. 在Parse.com中,用于更新对象的帮助文档似乎要求先查询才能检索对象,然后才能更新元数据。

Given that I know the objectId of the object I am updating, do I still have to make this additional call to retrieve everything else about the object before I can send an update call (via saveInBackground)? 鉴于我知道我要更新的对象的objectId,在发送更新调用(通过saveInBackground)之前,是否还需要进行此附加调用以检索有关该对象的所有其他信息?

Yes, you do. 是的你是。 In order to update an object from parse, you must have a local copy. 为了从解析中更新对象,您必须具有本地副本。

In order to make a call to update an object - which can take several forms of save or saveInBackground or saveEventually , etc. - you must first make a query to have a copy of the object. 为了进行调用以更新对象-它可以采用savesaveInBackgroundsaveEventuallysaveEventually -必须首先进行查询以获取对象的副本。

If you know the objectId, is sounds like you have already run a query on an associated object - why not get the full object then with an includeKey: call? 如果您知道objectId,听起来好像您已经在关联的对象上运行了查询-为什么不通过includeKey:调用获取完整的对象呢? https://www.parse.com/docs/ios_guide#queries-relational/iOS https://www.parse.com/docs/ios_guide#queries-relational/iOS

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

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