Skip to content

Commit 524a05c

Browse files
committed
update $$lte to use new AsFloat64 function
1 parent 3376842 commit 524a05c

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

internal/integration/unified/matches.go

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -251,19 +251,17 @@ func evaluateSpecialComparison(ctx context.Context, assertionDoc bson.Raw, actua
251251

252252
// Numeric values can be compared even if their types are different (e.g. if expected is an int32 and actual
253253
// is an int64).
254-
255-
// TODO(GODRIVER-3594): If we decide to add AsDoubleOK() as a method to RawValue, this following conversion should be updated.
256254
var expectedF64 float64
257255
if assertionVal.Type == bson.TypeDouble {
258256
expectedF64 = assertionVal.Double()
259257
} else {
260-
expectedF64 = float64(assertionVal.AsInt64())
258+
expectedF64 = assertionVal.AsFloat64()
261259
}
262260
var actualF64 float64
263261
if actual.Type == bson.TypeDouble {
264262
actualF64 = actual.Double()
265263
} else {
266-
actualF64 = float64(actual.AsInt64())
264+
actualF64 = actual.AsFloat64()
267265
}
268266

269267
if actualF64 > expectedF64 {

0 commit comments

Comments
 (0)