Test for inserting document with arbitrary index