官术网_书友最值得收藏!

Time for action — creating a document in Futon

We've gone through the updating of existing documents. Let's create a document from scratch in Futon.

  1. Go to the database overview by clicking on the database name, test-db, in the header.
  2. Click on New Document.
  3. A blank document is created and ready for us to put in new fields. Notice that the _id is already set for us (but we can change it if we want).
  4. Click on Add Field to create a new field, and call it location.
  5. Double-click on the value right next to the label that says null, and enter in your current location.
  6. Click on Add Field to create a new field, and call it name.
  7. Double-click on the value right next to the label that says null, and enter in your name.
  8. Click on Save Document at the top of the page.
  9. The document has been saved. Notice that it now has a _rev value set.

What just happened?

You just used Futon to create a document from scratch. When the document was first created, CouchDB created a unique ID for you to set it as the value of the _id field. Next, you added the name field and inputted your name as its value. Finally, you saved it to create a new document. We've talked about how documents can have completely different fields, but this is the first time we've actually done it!

主站蜘蛛池模板: 全州县| 雷州市| 齐齐哈尔市| 紫金县| 陇川县| 自治县| 双桥区| 观塘区| 许昌县| 徐水县| 凤凰县| 永泰县| 收藏| 石首市| 双柏县| 鄂伦春自治旗| 凤山市| 乐陵市| 宁强县| 东宁县| 犍为县| 瑞丽市| 彰化市| 通化县| 淅川县| 汝南县| 徐汇区| 通州区| 北安市| 盈江县| 定陶县| 长垣县| 黔东| 甘南县| 武强县| 大方县| 友谊县| 石首市| 喀喇沁旗| 襄樊市| 夏河县|