[SERVER-3168] add some convenient methods for BinData and UUID Created: 30/May/11 Updated: 12/Jul/16 Resolved: 31/May/11 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | None |
| Affects Version/s: | None |
| Fix Version/s: | 1.9.1 |
| Type: | Improvement | Priority: | Minor - P4 |
| Reporter: | Antoine Girbal | Assignee: | Antoine Girbal |
| Resolution: | Done | Votes: | 0 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Issue Links: |
|
||||||||||||
| Participants: | |||||||||||||
| Description |
|
MongoDB shell version: 1.9.1-pre- b = HexData(subtype,hexstr) create a BSON BinData value from a hex string o = new ObjectId() create a new ObjectId |
| Comments |
| Comment by auto [ 22/Jun/11 ] |
|
Author: {u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}Message: |
| Comment by Antoine Girbal [ 16/Jun/11 ] |
|
many thanks for report, I will fix that |
| Comment by Mark Lewis [ 16/Jun/11 ] |
|
I just tested the 2011-06-15 nightly, and the new .hex() method, while convenient, seems to have a bug where it drops zeroes, leading to incorrect results If I take a BinData(3, "OEJTfmD8twzaj/LPKLIVkA==") and convert to hex, I get the following (Correct output, then Mongo output): 38 42 53 7e 60 fc b7 0c da 8f f2 cf 28 b2 15 90 (spaces were added to separate the bytes, note the missing 0 on the most-significant byte in the UUID). This is also apparent because round-tripping the value to/from hex changes the value: > var x = new BinData(3, "OEJTfmD8twzaj/LPKLIVkA==") |
| Comment by auto [ 31/May/11 ] |
|
Author: {u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}Message: |
| Comment by auto [ 30/May/11 ] |
|
Author: {u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}Message: |
| Comment by auto [ 30/May/11 ] |
|
Author: {u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}Message: |
| Comment by auto [ 30/May/11 ] |
|
Author: {u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}Message: |
| Comment by auto [ 30/May/11 ] |
|
Author: {u'login': u'agirbal', u'name': u'agirbal', u'email': u'antoine@10gen.com'}Message: |