Mechanism for resistive switching in an oxide-based electrochemical metallization memory