What Would Be The More Optimal Schema To Embed The Address Data #196
What would be the more optimal schema to embed the address data entities in the patron data for following schema representing one to many relationships?</p> <pre><code class="language-text"> { _id: "joe", name: "Joe Bookreader" } { patron_id: "joe", street: "123 Fake Street", city: "Faketon", state: "MA", zip: "12345" } { patron_id: "joe", street: "1 Some Other Street", city: "Boston", state: "MA", zip: "12345" } </code></pre>
This multiple choice question (MCQ) is related to the book/course gs gs112 MongoDB. It can also be found in gs gs112 Data Models - Data Model Examples and Patterns - Quiz No.1.
What would be the more optimal schema to embed the address data entities in the patron data for following schema representing one to many relationships?
{ _id: "joe", name: "Joe Bookreader" } { patron_id: "joe", street: "123 Fake Street", city: "Faketon", state: "MA", zip: "12345" } { patron_id: "joe", street: "1 Some Other Street", city: "Boston", state: "MA", zip: "12345" }
{ _id: "joe", name: "Joe Bookreader", addresses: [ { street: "123 Fake Street", city: "Faketon", state: "MA", zip: "12345" }, { street: "1 Some Other Street", city: "Boston", state: "MA", zip: "12345" } ] } ?
{ _id: "joe", name: "Joe Bookreader", addresses: [ { street: "123 Fake Street", city: "Faketon", state: "MA", zip: "12345" }, [ street: "1 Some Other Street", city: "Boston", state: "MA", zip: "12345" ] ] } ?
{ _id: "joe", name: "Joe Bookreader", addresses: [ [ street: "123 Fake Street", city: "Faketon", state: "MA", zip: "12345" ], { street: "1 Some Other Street", city: "Boston", state: "MA", zip: "12345" } ] } ?
None of the mentioned
Similar question(s) are as followings:
Online Quizzes of gs112 MongoDB
GridFS, BSON Datatype and Administration Concepts - BSON - Quiz No.1
gs gs112 MongoDB
Online Quizzes