Add AsFloat64() and AsFloat64OK() method to RawValue

XMLWordPrintableJSON

    • Type: Task
    • Resolution: Done
    • Priority: Unknown
    • 2.5.0
    • Affects Version/s: None
    • Component/s: None
    • 🔵 Done
    • Go Drivers
    • Hide

      1. What would you like to communicate to the user about this feature?
      2. Would you like the user to see examples of the syntax and/or executable code and its output?
      3. Which versions of the driver/connector does this apply to?

      Show
      1. What would you like to communicate to the user about this feature? 2. Would you like the user to see examples of the syntax and/or executable code and its output? 3. Which versions of the driver/connector does this apply to?
    • None
    • None
    • None
    • None
    • None
    • None

      Context

      In GODRIVER-3518, we modified the $$lte operator test to accept doubles. We changed it to convert values (from int64/int32/double) to float64 rather than int64 for comparisons between numeric values with different BSON types.

      Definition of done

      Similar to how AsInt64() converts to int64, we should add a method AsFloat64() to RawValue to convert to float64.
      Similar to how AsInt64OK() converts to int64, we should add a method AsFloat64OK() to RawValue to convert to float64.

      Use the new methods in the $$lte logic of the unified test runner.

      Pitfalls

      What should the implementer watch out for? What are the risks?

            Assignee:
            Rafael Cenzano
            Reporter:
            Selena Zhou (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: