Shell inserts integers as doubles

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 1.8.0
    • Component/s: Shell
    • None
    • Environment:
      OS X 10.6.7, Mongo 1.8.0
    • Fully Compatible
    • OS X
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      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.

              Assignee:
              Unassigned
              Reporter:
              Tom Wardrop
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: