Store previous keys and docids in an array so the previous command
behaves as expected.