Uploaded image for project: 'MongoDB Shell'
  1. MongoDB Shell
  2. MONGOSH-1369

Expose and test static fromX bson type creation methods to Binary and ObjectId

    • Type: Icon: Task Task
    • Resolution: Fixed
    • Priority: Icon: Major - P3 Major - P3
    • 2.0.0
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Needed
    • Hide

      We added new methods into some shell objects:

      ObjectId: We exposed the new constructor `Object.createFromHexString`
      Binary: We exposed the new constructor `Binary.createFromBase64String` that should be used preferably.
      Also, Binaries are now printed differently in the shell, using the new Binary.Binary.createFromBase64String('the value as base64').

      An example image can be seen in: https://user-images.githubusercontent.com/1822138/256283057-fb62b890-81cc-4459-bc78-e4f60aea5c72.png

      Show
      We added new methods into some shell objects: ObjectId: We exposed the new constructor `Object.createFromHexString` Binary: We exposed the new constructor `Binary.createFromBase64String` that should be used preferably. Also, Binaries are now printed differently in the shell, using the new Binary.Binary.createFromBase64String('the value as base64'). An example image can be seen in: https://user-images.githubusercontent.com/1822138/256283057-fb62b890-81cc-4459-bc78-e4f60aea5c72.png

      Add support in the shell for the changes introduced in https://jira.mongodb.org/browse/NODE-4855

      Make sure the new form is used when displaying Binary objects

      Tasks:

      • ObjectId: we need to expose the createFromHexString method
      • Binary: we need to expose the createFromBase64String method
      • Binary, we will change how we print it in the REPL, to the new format: Binary.createFromBase64String('the value as base64')

            Assignee:
            kevin.mas@mongodb.com Kevin Mas Ruiz
            Reporter:
            maurizio.casimirri@mongodb.com Maurizio Casimirri
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: