MongoDB Tutorial 0/120 lessons ~6 min read Lesson 24

    One-to-One Relationships

    One-to-one (1:1) relationships always favor embedding in MongoDB.

    Course progress0%
    Focus
    4 guided sections
    Practice signal
    Examples included
    Career prep
    Foundation builder

    Introduction

    One-to-one (1:1) relationships always favor embedding in MongoDB. A user has one profile, an order has one shipping address, a product has one primary image. Put them in one document and skip the join forever.

    Syntax reference

    js
    // 1:1 — embed
    {
    _id: 1, name: "Ada",
    profile: { bio: "...", avatar: "https://..." }
    }

    Real-world use

    User + profile is the textbook 1:1 case — always embedded.

    Best practices

    • Embed 1:1 every time unless the child is huge (> 1 MB) or rarely read.
    Ready to mark this lesson complete?Track your journey across the entire course.