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

OR


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

Questions?

Ask questions via GitHub below OR chat on Slack #questions