O'Reilly logo

CouchDB and PHP Web Development Beginner's Guide by Tim Juravich

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Designing our user documents

We've seen in Chapter 3, Getting Started with CouchDB and Futon, how CouchDB looks at user documents. In this chapter, we are going to learn how to leverage existing CouchDB functionality and add some additional fields on top of it.

How CouchDB looks at basic user documents

CouchDB already has a mechanism for storing user documents, which we've already seen and used. We are going to use this same structure for the users of our application:

{
"_id": "org.couchdb.user:your_username",
"_rev": "1-b9af54a7cdc392c2c298591f0dcd81f3",
"name": "your_username",
"password_sha": "3bc7d6d86da6lfed6d4d82e1e4d1c3ca587aecc8",
"roles": [],
"salt": "9812acc4866acdec35c903f0cc072c1d",
"type": "user"
}

These seven fields are required by ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required