Reset array keys after documents are sorted