update collections on doc creation and deletion