Orphaned Documents View?

4 views
Skip to first unread message

N8 Sabes

unread,
Nov 23, 2015, 1:22:10 PM11/23/15
to Couchbase

Is it possible to have a view that contains only orphaned documents? In other words, a view that is a collection of documents that are not referenced by any others.


Example: DocType="Book" is the parent with many DocType="Page" children. How do you create a view of only those Books which have no Pages ---- without using an array of Pages within the Book doc.


Normally, when the last page is deleted, the Book doc will also automatically be deleted. *** However, if something goes wrong in the deletion process, a background cleanup function must go find all the orphaned books without pages and delete them.


How might this cleanup view be written (without using an array of pages within the Book doc.)?



Message has been deleted

N8 Sabes

unread,
Nov 26, 2015, 11:47:37 AM11/26/15
to Couchbase
Reply all
Reply to author
Forward
0 new messages