Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/kotlin/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Firestore/Kotlin FieldValue arrayRemove()&x2B;Firestore定价_Kotlin_Google Cloud Firestore - Fatal编程技术网

Firestore/Kotlin FieldValue arrayRemove()&x2B;Firestore定价

Firestore/Kotlin FieldValue arrayRemove()&x2B;Firestore定价,kotlin,google-cloud-firestore,Kotlin,Google Cloud Firestore,Firestore/Kotlin FieldValue arrayRemove()删除数组/列表中的已知元素。我关心的是移除数组中给定位置的元素,而不必知道元素本身。可能吗 例如,如果我的列表是{“Mowgli”、“Baloo”、“Bagheera”、“Kaa”、“Shere Kahn”},我想在不知道名称“Mowgli”的情况下删除第一个元素“Mowgli” FieldValue.arrayRemove([0]) 此外,关于谷歌的定价策略,“arrayRemove”是否被视为一个查询,因此它

Firestore/Kotlin FieldValue arrayRemove()删除数组/列表中的已知元素。我关心的是移除数组中给定位置的元素,而不必知道元素本身。可能吗

例如,如果我的列表是{“Mowgli”、“Baloo”、“Bagheera”、“Kaa”、“Shere Kahn”},我想在不知道名称“Mowgli”的情况下删除第一个元素“Mowgli”

FieldValue.arrayRemove([0])
此外,关于谷歌的定价策略,“arrayRemove”是否被视为一个查询,因此它的价格与设置10000个元素的完整类的价格相同

谢谢

我关心的是移除数组中给定位置的元素,而不知道元素本身。可能吗

不,不可能。如果要使用数组中项目的索引修改数组,则必须读取文档,在内存中修改数组,然后将数组字段全部更新回文档