[英]Difference between two maps when updating field in cloud firestore
var data = {
'key.number': 1,
};
var data = {
'key' : {
'number': 1,
}
};
Is there any difference between the two Map
s when updating number
on the cloud firestore using使用更新云 firestore 上的
number
时,两个Map
之间有什么区别
var ref = Firestore.instance.document('users/id');
ref.updateData(data);
If the document didn't already have a "key" field, there is no difference.如果文档还没有“关键”字段,则没有区别。
If the document did already have a "key" field, the first one would just overwrite any existing value for key.field
, preserving any other fields in the key object, and the second one would completely overwrite the key object and all of its existing fields.如果文档确实已经有一个“键”字段,第一个将覆盖
key.field
的任何现有值,保留键 object 中的任何其他字段,第二个将完全覆盖键 object 及其所有现有值领域。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.