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

Change in behavior on how $gte work with an array as a parameter

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Duplicate
    • Affects Version/s: 2.5.3
    • Fix Version/s: None
    • Component/s: Querying
    • Environment:
    • Backwards Compatibility:
      Major Change
    • Operating System:
      ALL

      Description

      The construct

      { $gte : [ ... ] }

      is processed differently between 2.4.5 and 2.5.4-Pre.

      Reproduce:

      db.q.drop()
      db.q.insert({"b" : [  1,  [  [  {   } ] ],  {  "1" : [  false ] } ] })
      db.q.insert({"b" : [  [  ISODate("2013-09-29T00:00:00Z") ] ] })
      db.q.insert({"b" : [ 	{ 	"0" : 0, 	"d" : { 	"a" : Infinity } }, 	[ 	{ 	"d" : { 	"a" : { 	 } } } ] ] })
      db.q.insert({"b" : [ 	[ 	ISODate("2008-02-29T00:00:00Z") ], 	"An inventor is simply a fellow who doesnt take his education too seriously." ] })
      db.q.find( { "b" : { $gte : [ 314159265015 , { } , { "a" : 314159265004 } ] } } ).itcount()
      db.q.find( { "b" : { $gte : [ 314159265015 , { } ] } } ).itcount()
      db.q.find( { "b" : { $gte : [ 314159265015 , { "a" : 314159265004 } ] } } ).itcount()
      db.q.find( { "b" : { $gte : [ { } ] } } ).itcount()

      2.4.5: 4 documents returned for each query
      2.5.4-Pre: Zero documents returned for each query

      Note:
      The query below returns the same (zero) documents on both versions

      db.q.find( { "b" : { $gte : 314159265015 } } ).itcount()

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                0 Vote for this issue
                Watchers:
                3 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: