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

conversions to dates don't accept constant arguments

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Duplicate
    • 2.1.1
    • None
    • Aggregation Framework
    • ALL

    Description

      Tried this

       
      var x = db.runCommand({aggregate: "foo", pipeline: [
        {$project: {
      //     doesn't work
      //      date: {$isoDate: {year: 2012, month: 2, dayOfMonth: 4} } ,
      /* // this worked - copy-pasted from testall.js
            testDate: {$isoDate:{
                year: "$year", month: "$month", dayOfMonth: "$dayOfMonth",
                hour: "$hour", minute: "$minutes", second: "$seconds"}}
      */
      // this didn't
            testDate: {$isoDate:{
                year: 2012, month: "$month", dayOfMonth: "$dayOfMonth",
                hour: "$hour", minute: "$minutes", second: "$seconds"}}
        }}
      ]});

      Get this error

      {
              "errmsg" : "exception: \"year\" numeric inclusion or exclusion must be 1
       or 0 (or boolean)",
              "code" : 15991,
              "ok" : 0
      }

      Looks like there's some kind of problem with the parser for this expression.

      Attachments

        Issue Links

          Activity

            People

              matt.dannenberg Matt Dannenberg
              dan@mongodb.com Daniel Pasette (Inactive)
              Votes:
              3 Vote for this issue
              Watchers:
              7 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: