Hierarchy Model a tree or hierarchy for threaded comments

This lesson is available for PRO members or as a single course purchase. Sign-in and choose a plan below.


*Enrollment provides full access to this course (and updates) for life.

Or Signup for Unlimited PRO Access

file_type_js_official firestore.js
const topLevel = db.collection('comments').where('parent', '==', false);


const level = db.collection('comments').where('parent', '==', id)


const traverseAll = (id) => {
    const tree = db.collection('comments')
    .where('parent', '>=', id)
    .where('parent', '<=', `${id}~`)
}

Q&A Chat