Categorize barrel database events into inserts, updates and deletes.
Changes on a database are not directly categorized as inserts, updates or deletes.
Presently detecting these categories is done indirectly e.g inserts have a rev
that begins with 1, updates have a rev
that begins with a value greater than 1, while deletes have a property "deleted" => true
.
It will be great for this categorization to be done natively instead of various apps having to do this themselves when connecting to Barrel.
Two suggestions on how this can be done:
- Adding a new property that identifies the type of change e.g
"category" => [ "insert" | "update" | "delete" ]
- I don't know much about the
changes
property but it seems all it contains is the rev which is already available in therev
property returned with the change. If all it does is list the rev just like therev
property then I suggest it be used to state the type of change e.g"changes" => [ "insert" | "update" | "delete"]