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

Invalid BSON docs lead to errors in complex queries

    • Type: Icon: Bug Bug
    • Resolution: Duplicate
    • Priority: Icon: Critical - P2 Critical - P2
    • None
    • Affects Version/s: 2.4.5, 2.4.6
    • Component/s: None
    • Labels:
    • Environment:
      linux ubuntu 12.10
    • Linux
    • Hide

      load this dump: http://privatepaste.com/download/576b7e1184

      run the index: db.users5.ensureIndex(

      { "_id": 1, "times.current_location": 1, "places.current.geolocation" : "2dsphere"}

      ,

      { "sparse": true }

      );

      run this command
      db.runCommand( { "geoNear": "users5", "near":

      { "type": "Point", "coordinates": [ 0,0 ] }

      , "spherical" : true } )

      Show
      load this dump: http://privatepaste.com/download/576b7e1184 run the index: db.users5.ensureIndex( { "_id": 1, "times.current_location": 1, "places.current.geolocation" : "2dsphere"} , { "sparse": true } ); run this command db.runCommand( { "geoNear": "users5", "near": { "type": "Point", "coordinates": [ 0,0 ] } , "spherical" : true } )

      I believe there are few documents stored in my db which are not BSON valid or cause issue when retured, since when they are included into the result set of $and $or $geonear queries they made it error. I have identified one record which is definitely causing this problem. The only thing I can see is when I print it on the shell it indents wrongly and misses some key, but when it is exported it is a valid JSON and the dump also looks a correct binary.

      db.runCommand( { "geoNear": 'users5', "near":

      { "type": "Point", "coordinates": [ 0, 0 ] }

      , "spherical": true, num: 1 } )
      {
      "ns" : "your_db.users5",
      "results" : [ ],
      "errmsg" : "exception: wrong type for field () 10 != 2",
      "code" : 13111,
      "ok" : 0
      }

      Further details on http://pastie.org/8308587

            Assignee:
            stephen.steneker@mongodb.com Stennie Steneker (Inactive)
            Reporter:
            fmoscon Fabrizio Moscon
            Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: