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

Shell inserts integers as doubles

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Works as Designed
    • Affects Version/s: 1.8.0
    • Fix Version/s: None
    • Component/s: Shell
    • Labels:
      None
    • Environment:
      OS X 10.6.7, Mongo 1.8.0
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      OS X

      Description

      I've observed that whenever the shell inserts an integer, whether it be by using a $set or an $inc in an update, or by inserting a new document, the integer gets stored in Mongo as a double. This becomes a problem when you're using the new $bit modifier as it doesn't work with doubles. I've narrowed the problem down to the Shell rather than a deeper problem, as 1.2.4 of the Ruby driver doesn't exhibit this problem.

      As a side issue, I'd suggest having the Shell displays doubles as such, e.g. with a trailing ".0" such as "5.0" instead of just 5. This would make it more obvious to identify such problems as this one in the future. It's only through Ruby that I can actually see that the integers being inserted by the Shell are actually doubles.

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: