受 Cloudant 和 Bluemix 支持的动态 Google Gauge(3)
 
- UID
- 1066743
|
受 Cloudant 和 Bluemix 支持的动态 Google Gauge(3)
第 3 步. 创建一个新 Cloudant 数据库并添加一个文档- 要启动 Cloudant 管理控制台,请单击 Bluemix 仪表板左侧的 Cloudant NoSQL DB 服务选项卡,然后单击 Launch。
在此控制台中,您可以创建和管理数据库。下一步是创建一个新数据库并在其中创建一个新文档。
- 在 Cloudant 管理控制台中,单击 Add New Database。
 - 将数据库命名为 gauge。
- 向 gauge 数据库添加一个文档。
 - 将以下 JSON 数据添加到新文档中并单击 Save。
1
2
3
4
5
| {
"_id": "Gauge-Data",
"id": "Gauge-Data",
"GaugeValue": "550"
}
|
备注:保存 JSON 数据后,会自动添加一个新字段 _rev,如下面这个代码清单所示。这是 Cloudant 添加到所有文档中的一个惟一值。这个值是必不可少的,但忽略它不会带来任何安全问题。
1
2
3
4
5
6
| {
"_id": "Gauge-Data",
"_rev": "8-6513e30087b34680b45739ca720d8a25",
"id": "Gauge-Data",
"GaugeValue": "550"
}
|
|
|
|
|
|
|