[SERVER-5288] use no more precision than necessary when reporting explain output Created: 12/Mar/12 Updated: 11/Jul/16 Resolved: 23/Mar/12 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 2.1.1 |
| Fix Version/s: | 2.1.1 |
| Type: | Bug | Priority: | Major - P3 |
| Reporter: | Eric Milkie | Assignee: | Aaron Staple |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Operating System: | ALL |
| Participants: |
| Description |
|
Can we go back to displaying longs as just numbers in the output? Are there other commands whose output is similarly affected?
|
| Comments |
| Comment by auto [ 23/Mar/12 ] |
|
Author: {u'login': u'astaple', u'name': u'Aaron', u'email': u'aaron@10gen.com'}Message: |
| Comment by Eliot Horowitz (Inactive) [ 12/Mar/12 ] |
|
You should use appendNumber() instead of append() |
| Comment by Aaron Staple [ 12/Mar/12 ] |
|
And it looks like the old explain was doing this for the values it was recording as long longs. I guess I'll fix by doing the same. |
| Comment by Aaron Staple [ 12/Mar/12 ] |
|
It looks like what I described above is what we do for stats() though. |
| Comment by Aaron Staple [ 12/Mar/12 ] |
|
The reason for this is that I changed the variables for recording certain values to long long from int, since in some cases we can potentially get counts that cannot be represented as ints. We could fix by only returning explain output using a bson long when a bson long is necessary to properly represent a value. But if this is primarily a shell ui issue that might not be an ideal fix. |
| Comment by Eric Milkie [ 12/Mar/12 ] |
|
The numbers shown as NumberLong() above are actually 64-bit long longs. There might be a way to construct the BSON such that when displayed, the long longs look like regular numbers. |