MongoDB add and update function: callback resource