I got this data in my document:
I want to delete index 0. How do I do this? This should do the trick I thought:
db.collection("data").document("free").updateData(["deleteme.deletemee.0" : FieldValue.delete()]) { (errr) in
print(errr)
}
But the errr prints nil, and nothing is removed. When getting the document I noticed something strange about the data when using this code:
db.collection("data").document("free").getDocument { (doc, err) in
guard let _doc = doc,
doc?.exists ?? false else{ return }
print(_doc.data())
}
This prints out:
["deleteme": {
deletemee = (
1 //this is the value for the key, but where is my key?! :(
);
}]
I cannot see the key, where is it? How to delete something at an index in Firestore? Thanks.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…