Replace document on insert