From commits-return-2343-apmail-couchdb-commits-archive=couchdb.apache.org@couchdb.apache.org Sat Apr 18 22:27:33 2009 Return-Path: Delivered-To: apmail-couchdb-commits-archive@www.apache.org Received: (qmail 31099 invoked from network); 18 Apr 2009 22:27:33 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 18 Apr 2009 22:27:33 -0000 Received: (qmail 78497 invoked by uid 500); 18 Apr 2009 22:27:33 -0000 Delivered-To: apmail-couchdb-commits-archive@couchdb.apache.org Received: (qmail 78416 invoked by uid 500); 18 Apr 2009 22:27:32 -0000 Mailing-List: contact commits-help@couchdb.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@couchdb.apache.org Delivered-To: mailing list commits@couchdb.apache.org Received: (qmail 78407 invoked by uid 500); 18 Apr 2009 22:27:32 -0000 Delivered-To: apmail-incubator-couchdb-commits@incubator.apache.org Received: (qmail 78404 invoked by uid 99); 18 Apr 2009 22:27:32 -0000 Received: from nike.apache.org (HELO nike.apache.org) (192.87.106.230) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Apr 2009 22:27:32 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.130] (HELO eos.apache.org) (140.211.11.130) by apache.org (qpsmtpd/0.29) with ESMTP; Sat, 18 Apr 2009 22:27:31 +0000 Received: from eos.apache.org (localhost [127.0.0.1]) by eos.apache.org (Postfix) with ESMTP id F0D9E118BD for ; Sat, 18 Apr 2009 22:27:09 +0000 (GMT) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Apache Wiki To: couchdb-commits@incubator.apache.org Date: Sat, 18 Apr 2009 22:27:09 -0000 Message-ID: <20090418222709.27906.47223@eos.apache.org> Subject: [Couchdb Wiki] Update of "EntityRelationship" by AlexanderKosenkov X-Virus-Checked: Checked by ClamAV on apache.org Dear Wiki user, You have subscribed to a wiki page or wiki category on "Couchdb Wiki" for change notification. The following page has been changed by AlexanderKosenkov: http://wiki.apache.org/couchdb/EntityRelationship ------------------------------------------------------------------------------ "phones":[{"number":"(650) 555 - 2200","type":"home"},{"number":"(650) 555 - 2201","type":"mobile"}], } }}} + + or even + + {{{ + { + "_id":"Scott", + "type":"contact", + "name":"My Friend Scott", + "phones":[{"home":"(650) 555 - 2200"},{"mobile":"(650) 555 - 2201"}], + } + }}} + Note how only the fields that we know are stored. Also note that the phone numbers are not simply an array, they are an array of associative hashes. We could extend this with no effort to add email addresses, IM names etc, even if IM names would need an extra attribute that has the service type. In essence, you're embedding child documents in the master document. That is the power of schema-less databases. == Many to Many ==