unflatten for redis