diff --git a/core/models/common/index_utils.go b/core/models/common/index_utils.go index 0a0028a2..ff0fd061 100644 --- a/core/models/common/index_utils.go +++ b/core/models/common/index_utils.go @@ -59,8 +59,9 @@ func normalizeIndexKey(key interface{}) string { pairs = append(pairs, fmt.Sprintf("%q:%v", elem.Key, elem.Value)) } - res, _ := bson.Marshal(pairs) - return string(res) + pairsBytes, _ := json.Marshal(pairs) + pairsStr := string(pairsBytes) + return pairsStr } func RecreateIndexes(col *mongo.Col, desiredIndexes []mongo2.IndexModel) {