Specify ObjectId representation with 24 lowercase hexadecimal characters

XMLWordPrintableJSON

    • Type: Spec Change
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Component/s: BSON
    • None
    • Needed

      Summary

      Ensure all drivers have a consistent representation of an ObjectId as string.

      • Generate string representation an ObjectId as a string of 24 hexadecimal characters in lowercase.
      • Accept lowercase and uppercase strings to create an ObjectId from a string representation.
      • Same for DBRef as that includes the string representation of an OID as well
      • Investigate for Binary and UUID

      Motivation

      Who is the affected end user?

      Application developers that use the string representation of an ObjectId. 

      How does this affect the end user?

      When string representation of an ObjectId is used as an identifier: example in a URL.

      How likely is it that this problem or use case will occur?

      Drivers should already accept lowercase and uppercase strings to instantiate ObjectId, but this needs to be be tested.

      If the problem does occur, what are the consequences and how severe are they?

      Consistency across drivers.

      Is this issue urgent?

      Minor.

      Is this ticket required by a downstream team?

      No.

      Is this ticket only for tests?

      Spec and tests.

      Acceptance Criteria

      New spec tests for creating an ObjectId from a string, and for generating a string representation of an ObjectId.

            Assignee:
            Unassigned
            Reporter:
            Jérôme Tamarelle
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: