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

Add Symbol Type Conversion to String

    XMLWordPrintable

Details

    • Improvement
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • 7.1.0
    • None
    • Persistence
    • 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

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

              Dates

                Created:
                Updated:
                Resolved: