Details

    • Type: New Feature
    • Status: Closed
    • Priority: Major - P3
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.5.3
    • Component/s: Querying
    • Labels:
      None

      Description

      > db.foo.ensureIndex(

      { a : 1 }

      )
      true
      > db.foo.ensureIndex(

      { b : 1 }

      )
      true
      > db.foo.find(

      { a : 1 }

      ).explain()
      {"cursor" : "BtreeCursor a_1" , "startKey" :

      {"a" : 1}

      , "endKey" :

      {"a" : 1}

      , "nscanned" : 2 , "n" : 2 , "millis" : 0 , "allPlans" : [{"cursor" : "BtreeCursor a_1" , "startKey" :

      {"a" : 1}

      , "endKey" : {"a" : 1}}]}
      > db.foo.find( { $or : [

      { a : 1 }

      ,

      { b : 1 }

      } ).explain()
      Wed Jun 17 06:57:15 JS Error: SyntaxError: missing ] after element list (anon):2147
      > db.foo.find( { $or : [

      { a : 1 }

      ,

      { b : 1 }

      ] ).explain()
      Wed Jun 17 06:57:20 JS Error: SyntaxError: missing } after property list (anon):2147
      > db.foo.find( { $or : [

      { a : 1 }

      ,

      { b : 1 }

      ] } ).explain()
      {"cursor" : "BasicCursor" , "startKey" : {} , "endKey" : {} , "nscanned" : 3 , "n" : 0 , "millis" : 0 , "allPlans" : [{"cursor" : "BasicCursor" , "startKey" : {} , "endKey" : {}}]}
      > for ( i=0; i<2000; i++ ){ db.foo.save(

      { a : i }

      ); }
      > for ( i=0; i<2000; i++ ){ db.foo.save(

      { h : i }

      ); }
      > for ( i=0; i<2000; i++ ){ db.foo.save(

      { b : i }

      ); }
      > db.foo.find( { $or : [

      { a : 1 }

      ,

      { b : 1 }

      ] } ).explain()
      {"cursor" : "BasicCursor" , "startKey" : {} , "endKey" : {} , "nscanned" : 6003 , "n" : 0 , "millis" : 2 , "allPlans" : [{"cursor" : "BasicCursor" , "startKey" : {} , "endKey" : {}}]}

        Attachments

          Issue Links

            Activity

              People

              • Votes:
                9 Vote for this issue
                Watchers:
                4 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: