bugs in generated JavaScript

XMLWordPrintableJSON

    • Type: Bug
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: None
    • Component/s: None
    • None
    • Environment:
      VS2008, .NET 3.5
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I was debugging one of my code and found interesting output for me.

      At the MongoQueryObject.Query there was text :

      { "$where":

      { "$code": "(((this.ServiceKey === 4c46d7657c1a601774000002) && (this.ResourceKey === 4c46d7657c1a601774000003)) && ((((this.Start >= 01/01/2000 10:00:00) && (this.Start < 01/01/2000 18:00:00)) || ((this.End > 01/01/2000 10:00:00) && (this.End <= 01/01/2000 18:00:00))) || ((this.Start < 01/01/2000 10:00:00) && (this.End > 01/01/2000 18:00:00))))" }

      }

      As i understand from MongoDb docs after $where should be JavaScrip
      code to run on server side.

      Question 1: why it didn't translated into json notation to find
      document ?
      Answer: maybe because we have more then one condition per field

      Question 2: if it is JavaScript code, why values don't have quotes
      '4c46d7657c1a601774000002' and '01/01/2000 10:00:00'

      Maybe better make like the following
      this.End <= new Date(2000,1,1,18,0,0)

      link: http://groups.google.com/group/mongodb-csharp/browse_thread/thread/b00e288d0ebce78

            Assignee:
            Craig Wilson
            Reporter:
            Timofei Mironov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: