One-to-Few Relationship
noun
say it: “WUN too FYOO rih-LAY-shun-ship” /wʌn tuː ˈfju rɪˈleɪʃənʃɪp/
A link between one item and a small number of others that won't grow much, such as a person and their few addresses.
What is a one-to-few relationship?
A one-to-few relationship links one thing to a small number of others that won't grow much, such as a bike and its three or four photos. The few are usually embedded, as an array inside the one.
db.bikes.insertOne({
name: "Trail Runner",
photos: [{ url: "side.jpg" }, { url: "front.jpg" }, { url: "gears.jpg" }]
});
In a sentence
- “A customer's two or three addresses are a one-to-few relationship, so they live inside the customer document.”
- “Calling it a one-to-few relationship settled it: the photos are embedded.”
Level: Journeyman · More MongoDB terms at this level
Updated