I want there always to be at least one document in database which has a field titled "selected
" set to true. How do I do that? Most probably I have to use callbacks, but which one: before (or after) _create, _upsert, _update
?
And how can I ensure that it will be set to true whatever operation executes: create, update, upsert...? I guess that would not be right to create a callback for each of them.