UPDATE: Added selection of range for indexed database