Uploaded image for project: 'Mongoid'
  1. Mongoid
  2. MONGOID-4900

Add Symbol Type Conversion to String

    XMLWordPrintable

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 7.1.0
    • Fix Version/s: None
    • Component/s: Persistence
    • Labels:
      None

      Description

      BSON has deprecated the Symbol type, and as a result the Mongo Ruby driver has also deprecated its use.

      Since Mongoid is an ODM it should convert attributes with the Symbol type to String during serialization of models to BSON, and convert strings returned in BSON back into Symbols.

      By design Mongoid is an ODM that performs these kinds of type conversions. For example BSON does not support Dates, so Mongoid transparently performs the necessary type conversions to and from UTC time.

      Let me know if I can submit a pull request with the proposed Symbol conversion feature.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              oleg.pudeyev Oleg Pudeyev
              Reporter:
              reidmo@gmail.com Reid Morrison
              Votes:
              1 Vote for this issue
              Watchers:
              4 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: