下面的寄存器结构捕获来自注册 UI 的数据:
register struct {
Email string
Password string }
collection.insert 命令创建以下文档:
{ "id": "1",
"email" : "john@example.com",
"password" : "pwd"
}
人口统计结构捕获来自人口统计 UI 的数据:
demographics struct {
Name string
Address string
}
我想更新文档,所以生成的文档如下:
{ "id": "1",
"email" : "john@example.com",
"password": "pwd",
"name" : "John Doe",
"address" : "100 Main Street"
}
使用 N1QL 我可以编写以下内容:
Update bucket set name="John Doe", address="100 Main Street" where id="1"
我在 GO SDK 中找不到更新 API。