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

Javascript parsing error in shell

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.0-rc4
    • Affects Version/s: 3.1.9, 3.2.0-rc2
    • Component/s: JavaScript, Querying
    • None
    • Fully Compatible
    • ALL
    • Hide

      1) Create data set with dates
      2) run query

      Show
      1) Create data set with dates 2) run query

      A 'where' query that worked with 3.0.6 does not work with 3.1.9 and 3.2.0-rc2.

      > db.datetest.find({"$where" : "(this.beginDate == null || this.beginDate > new Date()) && (this.endDate == null || this.endDate > new Date())"})
      Error: error: {
      	"waitedMS" : NumberLong(0),
      	"ok" : 0,
      	"errmsg" : "SyntaxError: expected expression, got keyword 'return' @:1:24\n",
      	"code" : 139
      }
      

            Assignee:
            jonathan.reams@mongodb.com Jonathan Reams
            Reporter:
            steven.hand Steven Hand
            Votes:
            2 Vote for this issue
            Watchers:
            10 Start watching this issue

              Created:
              Updated:
              Resolved: