0

我很难理解数据类型。也许我错过了一些东西,因为我在理解它们时感觉完全偏离了道路。

以下是我脑海中徘徊的所有问题:

  • 如何删除数据类型?似乎 UI 中没有按钮,也没有可以提供帮助的 Cloud Code API。
  • 为什么如果我创建一个数据索引,它会创建一个与数据索引同名的新数据类型?

如果所有这些都没有意义,我认为我比我想象的更偏离道路。

4

1 回答 1

0

About deleting by UI, from GameSpark Documentation:

You can Drop a Data Type to remove all of its data

To remove just an item inside a Data Type just open the data type, find the item, click on it, then click on remove (in case of one result) or on the bin icon (in case of multiple results).

About deleting by cloud code, from GameSpark form, seem like you have to delete the document inside the item:

 var sparkDataGetResult = Spark.getGameDataService().getItem(myDataType, myId);
 var sparkDataItem = sparkDataGetResult.document();
 sparkDataItem.delete();`

You can iterate on a Spark.getGameDataService().queryItems(string type, SparkDataCondition condition) if you need to delete more items at once by cloud code. More here

About the Data Index, its menu allow you to add indexes only on existing Data Types, so it will create a Data Types before adding an index. More about indexes here

于 2018-08-27T15:49:42.070 回答