Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-793

mongo shell: display "floatApprox" only when approximating bson int/long

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • 1.3.4
    • Shell
    • None

    Description

      Unlike 1.2.x, 1.3.4's shell displays

      { "floatApprox" } on every bson_long/bson_int field, even when the displayed value is exact. This makes the output larger and harder to read. Change such that { "floatApprox" }

      is only displayed when the double representation is actually inexact.

      IRC:
      <rphlx> what's up with the floatApprox stuff in the 1.3.x shell? i.e. 1.2.3 had "user_id" : 1; 1.3x has "user_id" :

      { "floatApprox" : 1 }

      . user_id is a bson_long..
      <mdirolf> rphlx: JS has no real way of representing a long
      <mdirolf> everything is a "Number" (double precision floating point) in JS
      <rphlx> fine, but i am using ints less than 53 bits, that fit in a double mantissa. there's no approximation, they're exact
      <mdirolf> rphlx: yeah when things fit in mantissa i would vote for just representing directly
      <rphlx> eh, is there a way to turn off the "floatApprox" display? i don't need to be reminded of js limitations on every field
      <mdirolf> rphlx: don't think so - but maybe open a case in jira to only use it when necessary like you suggest

      Attachments

        Activity

          People

            eliot Eliot Horowitz (Inactive)
            rphlx rphlx
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: