Uploaded image for project: 'Documentation'
  1. Documentation
  2. DOCS-10862

Docs for SERVER-23410: Improve or remove support for dates in string expressions

    XMLWordPrintable

    Details

    • Type: Task
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.5.14, 3.6.0-rc0
    • Component/s: None
    • Labels:
      None

      Description

      Documentation Request Summary:

      No documentation summary in engineering ticket

      Engineering Ticket Description:

      A couple string expressions (notably in $substr(Bytes) and $concat) support dates as inputs, but do not include the number of milliseconds:

      > db.foo.insert({x: new Date()})
      WriteResult({ "nInserted" : 1 })
      > db.foo.find()
      { "_id" : ObjectId("56fae3003ef38a5ce210b230"), "x" : ISODate("2016-03-29T20:18:08.339Z") }
      > db.foo.aggregate({$project: {x: {$substr: ["$x", 0, 200]}}})
      { "_id" : ObjectId("56fae3003ef38a5ce210b230"), "x" : "2016-03-29T20:18:08" }
      

      We should either fix these places to include the number of milliseconds, or remove support for using these expressions with date types.

      One possible way forward is to add a $toString expression (related to SERVER-11400), then remove support and require an explicit conversion instead.

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              kevin.albertson Kevin Albertson
              Reporter:
              kay.kim Kay Kim (Inactive)
              Participants:
              Last commenter:
              Kay Kim (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:
                Days since reply:
                3 years, 6 weeks, 1 day ago
                Date of 1st Reply: