A hook that is triggered after a count()
operation.
The afterCount()
hook runs when:
count()
function is called.Return a number or a Promise that resolves to number from the afterCount()
function. The returned number will be used as the result of the call to
count()
instead of the actual count of
items found in the collection. If returning a Promise, the number is used as
the result, whether the Promise is fulfilled or rejected.
If the returned value is of the wrong type, the value is ignored.
A rejected Promise also calls the onFailure()
hook if it has
been registered.
The number of items the count operation has found.
Contextual information about the hook.