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

Query parameters are not being honored

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major - P3
    • Resolution: Works as Designed
    • 2.0.4, 2.2.2
    • None
    • Querying
    • None
    • ALL
    • Hide

      Please see queries in description.

      Show
      Please see queries in description.

    Description

      > db.challenge_157_daily_scores.find(
      ...

      { ... 'g': 1, ... 'd':ISODate("2013-03-07T00:00:00Z") ... }

      ,
      ...

      { ... 'i':1, ... 'g':1 ... }

      ).hint(
      ...

      { ... g:1, ... d:-1, ... s:-1, ... i:1, ... t:1 ... }

      ).sort(
      ...

      { ... g:1, ... d:-1, ... s:-1, ... i:1, ... t:1 ... }

      )._addSpecial('$returnKey',true).min(
      ...

      { ... g:1, ... d:ISODate("2013-03-07T00:00:00Z"), ... s:100000, ... i:1, ... t:'u' ... }

      );

      { "g" : 1, "i" : 24579031 } { "g" : 1, "i" : 24579049 } { "g" : 1, "i" : 24579022 } { "g" : 1, "i" : 24579013 } { "g" : 1, "i" : 24579033 } { "g" : 1, "i" : 24579045 } { "g" : 1, "i" : 24579014 } { "g" : 1, "i" : 24579032 } { "g" : 1, "i" : 24579038 } { "g" : 1, "i" : 24579019 }

      Looks good!

      > db.challenge_157_daily_scores.find(
      ...

      { ... 'g': 1, ... 'd':ISODate("2013-03-07T00:00:00Z") ... }

      ,
      ...

      { ... 'i':1, ... 'g':1 ... }

      ).hint(
      ...

      { ... g:1, ... d:-1, ... s:-1, ... i:1, ... t:1 ... }

      ).sort(
      ...

      { ... g:1, ... d:-1, ... s:-1, ... i:1, ... t:1 ... }

      )._addSpecial('$returnKey',true).min(
      ...

      { ... g:1, ... d:ISODate("2013-03-07T00:00:00Z"), ... s:1, ... i:1, ... t:'u' ... }

      );

      { "g" : 2, "i" : 24579031 } { "g" : 2, "i" : 24579049 } { "g" : 2, "i" : 24579033 } { "g" : 2, "i" : 24579045 }

      Looks bad! g should be 1.

      > db.challenge_157_daily_scores.find(
      ...

      { ... 'g': 1, ... 'd':ISODate("2013-03-07T00:00:00Z") ... }

      ,
      ...

      { ... 'i':1, ... 'g':1 ... }

      ).hint(
      ...

      { ... g:1, ... d:-1, ... s:-1, ... i:1, ... t:1 ... }

      ).sort(
      ...

      { ... g:1, ... d:-1, ... s:-1, ... i:1, ... t:1 ... }

      )._addSpecial('$returnKey',true).min(
      ...

      { ... g:1, ... d:ISODate("2013-03-07T00:00:00Z"), ... s:1000, ... i:1, ... t:'u' ... }

      );

      { "g" : 1, "i" : 24579045 } { "g" : 1, "i" : 24579014 } { "g" : 1, "i" : 24579032 } { "g" : 1, "i" : 24579038 } { "g" : 1, "i" : 24579019 } { "g" : 2, "i" : 24579031 } { "g" : 2, "i" : 24579049 } { "g" : 2, "i" : 24579033 }

      Is it running over somehow? Why doesn't it stop before g = 2.

      Attachments

        Activity

          People

            aaron Aaron Staple
            carl.youngblood Carl Youngblood
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: