Patch now takes id parameter separately.
Generic version of replace and update document functionality.