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

$uniqueDocs validation does not error with "uniquedocs" or "$uniquedocs" tag names.

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 2.5.4
    • Affects Version/s: 2.4.5
    • Component/s: Querying
    • Environment:
    • ALL

      Problem:
      The validation for the $geoWithin allows enormous values to be passed into the query without throwing an error.

      Reproduce:

      2.4.5

      db.q.drop()
      db.q.find( { "loc" : { $geoWithin : { $polygon : [ [ 0.0 , 89.9 ] , [ -25 , 33.3 ] , [ 180.0 , -33.3 ] ] , uniquedocs : false } } }  )
      db.q.find( { "loc" : { $geoWithin : { $polygon : [ [ 0.0 , 89.9 ] , [ -25 , 33.3 ] , [ 180.0 , -33.3 ] ] , $uniquedocs : false } } }  )
      db.q.find( { "loc" : { $geoWithin : { $polygon : [ [ 0.0 , 89.9 ] , [ -25 , 33.3 ] , [ 180.0 , -33.3 ] ] , $uniqueDocs : false } } }  )
      

      No error pr documents are returned.

      2.5.4-Pre

      db.q.drop()
      db.q.find( { "loc" : { $geoWithin : { $polygon : [ [ 0.0 , 89.9 ] , [ -25 , 33.3 ] , [ 180.0 , -33.3 ] ] , uniquedocs : false } } }  )
      error: { "$err" : "bad query: BadValue bad geo query", "code" : 16810 }
      
      db.q.find( { "loc" : { $geoWithin : { $polygon : [ [ 0.0 , 89.9 ] , [ -25 , 33.3 ] , [ 180.0 , -33.3 ] ] , $uniquedocs : false } } }  )
      error: { "$err" : "bad query: BadValue bad geo query", "code" : 16810 }
      
      db.q.find( { "loc" : { $geoWithin : { $polygon : [ [ 0.0 , 89.9 ] , [ -25 , 33.3 ] , [ 180.0 , -33.3 ] ] , $uniqueDocs : false } } }  )
      

            Assignee:
            Unassigned Unassigned
            Reporter:
            alvin Alvin Richards (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: