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

Shell inserts integers as doubles

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

      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.

            Unassigned Unassigned
            wardrop Tom Wardrop
            0 Vote for this issue
            3 Start watching this issue