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

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Major - P3 Major - P3
    • None
    • Affects Version/s: 2.5.3
    • Component/s: Querying
    • Environment:
    • Major Change
    • ALL

      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()
      

            Assignee:
            hari.khalsa@10gen.com hari.khalsa@10gen.com
            Reporter:
            alvin Alvin Richards (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: