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

Standardize behavior of non-string inputs to string expressions

    • Type: Icon: Task Task
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None

      Some string expressions such as $substr, $substrBytes, $substrCP, $strcasecmp, $toLower and $toUpper will coerce their inputs to a string, allowing numbers, code, etc. to be converted as input. Others, such as $strLenBytes and $strLenCP will only allow string inputs, resulting in an error on any other input. Still others, such as $trim, $rtrim, $ltrim, $indexOfBytes, $indexOfCP, $split, and $concat will return null on any nullish input, and only accept strings otherwise.

      We need to decide which of these behaviors is most useful and most consistent, and update the others to be consistent.

            Assignee:
            charlie.swanson@mongodb.com Charlie Swanson
            Reporter:
            charlie.swanson@mongodb.com Charlie Swanson
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: