Many-to-Many Model and query a many-to-many relationship This lesson is available for PRO members or as a single course purchase. Sign-in and choose a plan below. SignUp for Unlimited PRO Access OR *Enrollment provides full access to this course (and updates) for life. 📼 Login to Watch 👈 One-to-Many Duplication 👉 file_type_js_official firestore.js const authorId = 'dr-seuss'; const bookId = 'lorax'; // 7. Middle Man Collection const userReviews = db.collection('reviews').where('author', '==', authorId); const bookReviews = db.collection('reviews').where('book', '==', bookId); // Single read with composite key const specificReview = db.collection('reviews').doc(`${bookId}_${authorId}`); // 8. Map // Reviews embadded on books const bookWithReviews = db.collection('books').doc(bookId); const userReviews = db.collection('books').orderBy('reviews.jeff-delaney'); // 9. Array const books = db.collection('books').where('categories', 'array-contains', 'fiction'); // 10. Bucket // Get a collection of documents with an array of IDs const getLikedBooks = async() => { // Get books through user likes const userLikes = await db.collection('likes').orderBy('jeff-delaney').get(); const bookIds = userLikes.docs.map(snap => snap.id); const bookReads = bookIds.map(id => db.collection('books').doc(id).get() ); const books = Promise.all(bookReads) } getLikedBooks() Chapters Intro 👶 1 Resources Helpful Resources supporting the Cloud Firestore Course 1:53 👶 2 What is Firestore A brief history of Cloud Firestore 3:16 👶 3 Firestore vs SQL Comparing Firestore to RDBMS or SQL 2:17 Core Concepts 🔥 4 Data Types How data types in Firestore are used for relational models. 3:10 🔥 5 Techniques The four main techniques for data modeling in Firestore 3:44 🔥 6 Read How to read individual documents. free 2:55 🔥 7 Query How to query collections of documents. 3:22 🔥 8 Indexes When to create indexes and how do manage them. 1:06 🔥 9 Security Security considerations with data modeling 1:22 Relational Data Modeling 👪 10 Cardinality How to model data based on the size of a set free 1:30 👪 11 One-to-One Model and query a one-to-one relationship 2:01 👪 12 One-to-Many Model and query a one-to-many relationship 2:20 👪 13 Many-to-Many Model and query a many-to-many relationship 4:09 Advanced Techniques 📐 14 Duplication How to eliminate reads with data duplication 1:00 📐 15 Aggregation Use Cloud Functions to maintain computed values 1:28 Example Models 🎁 16 Votes Model reddit-style votes in Firestore 2:04 🎁 17 Role-Based Authorization Role-based access control and security rules 3:25 🎁 18 Access Control List Use an ACL for fine-grained user authorization 2:26 🎁 19 Hierarchy Model a tree or hierarchy for threaded comments 3:07 🎁 20 Follower Feed User-to-user follows and follower feeds 4:21 Bonus Round 🍰 21 Top Five Five Firestore Data Modeling Techniques from the Course free 11:45 🚨 22 Collection Group Queries New feature alert! Query across multiple subcollections. 1:56