fix the datastruct in mongodb