Get started with your own database.

Hierarchical Data

A hierarchical relation (sometimes called a parent-child) is a convenient way of organizing and viewing information. If you think about it, we use it all the time:

  • Folders and files on your computer
  • Comments on a blog post
  • Activities on a project
  • Interactions with a customer

JSON format

Storing a child record has no effect on the parent record data fields. Instead the child record gets 3 meta data field (_parent_id, _parent_def, _parent_field) as a reference to its parent:

    _id: "57fcae958e37a512000005c9"
    title: "Bug in the code"
    followup: "2016-10-11T00:00:00.000Z"
    description: "Bla bla bla"
    _parent_id: "5630807cb153815f0000007b"
    _parent_def: "contact"
    _parent_field: "issues"

Video example

Creating this form of relation is simple in The video below show how you can add one Collection (Issues) as a child of another (Contact), i.e. issue tracking for customers.