> On Wed, Dec 8, 2010 at 13:34, He Shiming <[email protected]> wrote: > > 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 >
Thanks again for clarifying. So this is one database per project, and inside this database, everything is flat document. Each user has one document. Now if each user has several blogs, each with several articles, do these information fit into the user document? Or do I create separate documents, with "type" field set to either "blog" or "article"? Most apps are user-oriented. Everything is tied to a user. Does that mean everything related to this user fits into the user document? Will this approach introduce any difficulty later on? -- Best regards, He Shiming
