- CouchDB and PHP Web Development Beginner’s Guide
- Tim Juravich
- 238字
- 2021-08-13 18:22:53
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.
- Go to the database overview by clicking on the database name,
test-db
, in the header. - Click on New Document.
- 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). - Click on Add Field to create a new field, and call it
location
. - Double-click on the value right next to the label that says null, and enter in your current location.
- Click on Add Field to create a new field, and call it
name
. - Double-click on the value right next to the label that says
null
, and enter in your name. - Click on Save Document at the top of the page.
- 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!
推薦閱讀
- JavaScript百煉成仙
- Python數據分析入門與實戰
- 測試驅動開發:入門、實戰與進階
- 少年輕松趣編程:用Scratch創作自己的小游戲
- jQuery從入門到精通 (軟件開發視頻大講堂)
- GeoServer Beginner's Guide(Second Edition)
- MongoDB權威指南(第3版)
- 自然語言處理Python進階
- Learning Concurrent Programming in Scala
- HTML+CSS+JavaScript網頁設計從入門到精通 (清華社"視頻大講堂"大系·網絡開發視頻大講堂)
- Learning Material Design
- Django Design Patterns and Best Practices
- Getting Started with Electronic Projects
- Java EE 8 and Angular
- Spring Data JPA從入門到精通