min max not working as expected error: { "$err" : "no index found for specified keyPattern: {}" }

XMLWordPrintableJSON

    • Type: Question
    • Resolution: Done
    • Priority: Major - P3
    • None
    • Affects Version/s: 1.2.1
    • Component/s: Querying
    • None
    • Environment:
      Mac OS X, mongo command line
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      I may be missing something but am thinking that the test below points out a bug, but I maybe be missing something

      set up collection:-
      db.test.save({ "_id" : "IBM.N|00001264779918428889", "DESCRIPTION" :

      { "n" : "IBM STK2", "o" : "IBM STK", "s" : "changed" }

      }
      db.test.save({ "_id" : "VOD.N|00001264779918433344", "COMPANYNAME" :

      { "n" : "Vodafone Group PLC 2", "o" : "Vodafone Group PLC", "s" : "changed" }

      })
      db.test.save({ "_id" : "IBM.N|00001264779918437075", "DESCRIPTION" :

      { "n" : "IBM STK3", "o" : "IBM STK2", "s" : "changed" }

      })
      db.test.save({ "_id" : "VOD.N|00001264779918441426", "COMPANYNAME" :

      { "n" : "Vodafone Group PLC 3", "o" : "Vodafone Group PLC 2", "s" : "changed" }

      })

      I am expecting that

      db.test.find().min(

      {"_id":"IBM.N|00000000000000000000"}

      ).max(

      {"_id":"IBM.N|99999999999999999999"}

      );

      should return
      { "_id" : "IBM.N|00001264779918428889", "DESCRIPTION" :

      { "n" : "IBM STK2", "o" : "IBM STK", "s" : "changed" }

      }
      { "_id" : "IBM.N|00001264779918437075", "DESCRIPTION" :

      { "n" : "IBM STK3", "o" : "IBM STK2", "s" : "changed" }

      }

      and not

      error: { "$err" : "no index found for specified keyPattern: {}" }

            Assignee:
            Eliot Horowitz (Inactive)
            Reporter:
            Garry Wright
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved: