Uploaded image for project: 'C# Driver'
  1. C# Driver
  2. CSHARP-52

bugs in generated JavaScript

    XMLWordPrintableJSON

Details

    • Icon: Bug Bug
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • None
    • None
    • None
    • None
    • VS2008, .NET 3.5

    Description

      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

      Attachments

        Activity

          People

            craig.wilson@mongodb.com Craig Wilson
            bug0r Timofei Mironov
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: