From 5e7006b8ddb88f533529aae5bc95be1ef3be1623 Mon Sep 17 00:00:00 2001 From: wangyaqi Date: Tue, 4 Feb 2020 19:16:07 +0800 Subject: [PATCH] =?UTF-8?q?docs:=20=E6=B7=BB=E5=8A=A0set=E6=8F=8F=E8=BF=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- docs/uniCloud/cf-database.md | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/uniCloud/cf-database.md b/docs/uniCloud/cf-database.md index 1cba2b51..f681a9ca 100644 --- a/docs/uniCloud/cf-database.md +++ b/docs/uniCloud/cf-database.md @@ -610,8 +610,13 @@ collection.doc('doc-id').update({ ``` ### 更新文档,如果不存在则创建 + collection.doc().set() +**注意:** + +- 此方法会覆写已有字段,需注意与`update`表现不同,比如以下示例执行`set`之后`follow`字段会被删除 + ```js collection.doc('doc-id').set({ name: "Hey", -- GitLab