我有一个存储地图对象的 sembast 商店。如果我想删除地图中的一个键,我是否必须更新整个地图对象,或者有没有办法在不更新整个地图的情况下删除该键?文档仅显示如何删除记录,而不是如何删除字段。既然有更新单个字段的方法,我觉得把这个特性用于其他操作是有意义的。
例子:
// store a map that contains another map
int key = await petStore.add(db, {'name': 'fish', friends : {'cats' : 0, 'dogs' : 0}});
// update just the cats attribute
await petStore.record(key).update{'friends.cats' : 2};
// now I want to (if it is possible) remove the cats attribute without calling
await petStore.record(key).update({'name': 'fish', friends : {'dogs' : 0}})