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

$toDate fail on NumberInt

    • Type: Icon: Bug Bug
    • Resolution: Won't Fix
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • Labels:
      None
    • Query Execution
    • ALL
    • 55

      db.coll.drop();
      db.coll.insert({a: NumberInt(1)});
      db.coll.aggregate([{$addFields: {b: {$toDate: "$a"}}}]);
      

      Error:

      PlanExecutor error during aggregation :: caused by :: Unsupported conversion from int to date in $convert with no onError value
      

      Note it works if we change NumberInt to long or double.

            Assignee:
            Unassigned Unassigned
            Reporter:
            rui.liu@mongodb.com Rui Liu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: