incubator-couchdb-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dale Ragan <dale.ra...@sinesignal.com>
Subject Would there be a problem with storing documents with this structure?
Date Sun, 30 Aug 2009 19:31:32 GMT
Basically I have a document, with an id, rev, type, and Content keys.  The Content key
holds the serialized object that is to be stored for it's value.  Are there any pitfalls
with this design?  I have attached a sample below:

{
    "|_id|":|"000144df-6f11-49f1-a502-e0dab3592326"|,
    "|_rev|":|"1-308931e16105b566e1fb48106c85116e"|,
    "|type|":|"Manager"|,
    "|Content|": {
        "|Subordinates|": [
            {
                "|Address|": {
                    "|Street|":|"123 Somewhere St."|,
                    "|City|":|"Kalamazoo"|,
                    "|State|":|"MI"|,
                    "|Zip|":|"12345"|
                },
                "|Hours|":|40|,
                "|Id|":|"6bcdea2f-2439-4785-ab59-2ee612435705"|,
                "|Name|":|"Bob"|,
                "|Login|":|"bbob"|
            },
            {
                "|Address|": {
                    "|Street|":|"123 Somewhere St."|,
                    "|City|":|"Kalamazoo"|,
                    "|State|":|"MI"|,
                    "|Zip|":|"12345"|
                },
                "|Hours|":|40|,
                "|Id|":|"b0d156c9-ea3f-4c4f-b49d-ab19bff64dd8"|,
                "|Name|":|"Alice"|,
                "|Login|":|"aalice"|
            },
            {
                "|Address|": {
                    "|Street|":|"123 Somewhere St."|,
                    "|City|":|"Kalamazoo"|,
                    "|State|":|"MI"|,
                    "|Zip|":|"12345"|
                },
                "|Hours|":|20|,
                "|Id|":|"12b6dbbc-44e8-43c2-8142-11fc6c1d23df"|,
                "|Name|":|"Eve"|,
                "|Login|":|"eeve"|
            }
        ],
        "|Id|":|"000144df-6f11-49f1-a502-e0dab3592326"|,
        "|Name|":|"6"|,
        "|Login|":|"6-login"|
    }
}

Basically the content is a Manager type object with an Id, Name, Login, and Subordinates.
Subordinates are Worker's with an Id, Name, Login, Hours, and an Address.  The _id and the
Id of
the Manager object are the same.  Basically the Document object is just a wrapper around what
is
given to be persisted.

Thanks,

Dale


Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message