Is there any more efficient way of fetching such hierarchical data?
There are some “fake join” techniques, but they wouldn’t work across two levels of indirection like your example.
In a fake join you create a view that contains rows from both types of documents, and you design the keys so that the rows for a parent and children are adjacent; then you can either query normally and get the parent and children, or you can use grouping to aggregate info about them. I covered this in an “Advanced Couchbase Lite” talk I gave at the Couchbase conference last year; you can find video of it online.
—Jens