also record the ids of all documents changed