Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-11157

Type casting operator for aggregation (and query)

    • Type: Icon: New Feature New Feature
    • Resolution: Duplicate
    • Priority: Icon: Minor - P4 Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: None
    • None

      The aggregation framework is great and has very powerful operators. You can apply string operations, calculate with numbers and dates etc. Unfortunately you must have the right type to begin with to make use of all these That's not always the case! For instance it is sufficient that you have a field containing "7x8" and there's nothing you can do to calculate (i.e. area in sqm) or compare anything (numerically). Especially, I'm missing an operator to at least convert a string to an integer: {$cast=>"number"} or something like that. I hope, this isn't too complicated to implement - that's why I'm proposing it here. Being able to use it for normal queries (i.e. without aggregaton) would be very cool as well.

            Assignee:
            Unassigned Unassigned
            Reporter:
            rgpublic rgpublic
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: