diff --git a/internal/verifier/migration_verifier.go b/internal/verifier/migration_verifier.go index 485b59c4..6320a273 100644 --- a/internal/verifier/migration_verifier.go +++ b/internal/verifier/migration_verifier.go @@ -905,12 +905,10 @@ func (verifier *Verifier) doIndexSpecsMatch(ctx context.Context, srcSpec bson.Ra ctx, mongo.Pipeline{ {{"$documents", []bson.D{ - {{"spec", srcSpec}}, - }}}, - - // Add the destination spec. - {{"$addFields", bson.D{ - {"dstSpec", dstSpec}, + { + {"spec", bson.D{{"$literal", srcSpec}}}, + {"dstSpec", bson.D{{"$literal", dstSpec}}}, + }, }}}, {{"$unset", lo.Reduce( diff --git a/internal/verifier/migration_verifier_test.go b/internal/verifier/migration_verifier_test.go index 6c83e3db..6fc76e7d 100644 --- a/internal/verifier/migration_verifier_test.go +++ b/internal/verifier/migration_verifier_test.go @@ -1047,6 +1047,19 @@ func (suite *IntegrationTestSuite) TestVerifierCompareIndexSpecs() { shouldMatch: true, }, + { + label: "ignore number types, deep", + src: bson.D{ + {"name", "testIndex"}, + {"key", bson.M{"foo.bar": float64(123)}}, + }, + dst: bson.D{ + {"name", "testIndex"}, + {"key", bson.M{"foo.bar": 123}}, + }, + shouldMatch: true, + }, + { label: "find number differences", src: bson.D{