On Wed, Dec 8, 2010 at 13:34, He Shiming <[email protected]> wrote:
> So one database for one project, and one document for a kind of data
> huh? That's very helpful, thank you very much.

That's not exactly what I was saying. I have one document per user.

> One follow up question. Why do you use marker fields for each
> document, as opposed to just use "user" as the key for the "user
> document"? Does this have any advantage in view design?

An example: this app has two users, you and me. Documents:

{"_id": "dirkjan", "name": ["Dirkjan", "Ochtman"], "type": "user"}
{"_id": "he", "name": ["He", "Shiming"], "type": "user"}

Now I can easily build views that take the "document type" into
account (get all users), and I can easily make an atomic update of all
information related to one user.

Hope that helps,

Dirkjan

Reply via email to