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

Add Symbol Type Conversion to String

    • Type: Icon: Improvement Improvement
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 7.1.0
    • Component/s: Persistence
    • None

      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.

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

              Created:
              Updated:
              Resolved: