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.
Get Unlimited PRO Access


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

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}~`)


Ask questions via GitHub below OR chat on Slack #questions