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

Aggregation geoNear deprecated uniqueDocs warning

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor - P4
    • Resolution: Fixed
    • Affects Version/s: 2.6.9
    • Fix Version/s: 3.0.3, 3.1.1
    • Component/s: Aggregation Framework, Geo
    • Labels:
      None
    • Backwards Compatibility:
      Fully Compatible
    • Operating System:
      Linux
    • Backport Completed:
    • Steps To Reproduce:
      Hide

      1) prepare collection (mydb)

      db.timezone.ensureIndex({'shp':'2dsphere'})
      

      2) insert sample doc into "timezone" collection

      curl -sSL https://gist.github.com/jaymecd/71224330eaf6bfbb5676/raw/tzdoc.json | mongoimport -d mydb -c timezone --upsert
      

      3) run command w/o uniqueDocs - see warning

      db.timezone.aggregate([ { $geoNear: { near: { type: "Point", coordinates: [ -84.198026746273, 39.89626511522 ] }, spherical: true, maxDistance: 50002, distanceField: "dist" } }, { $limit: 2 }, { $sort: { pos: 1, dist: 1 } }, { $match: { pos: 1 } }, { $project: { _id: 0, iso: "$cco" } }, { $limit: 1 } ]);
      

      4) check logs and find warning

      2015-04-01T11:21:15.344+0000 [conn72] warning: mydb.timezone: ignoring deprecated uniqueDocs option in geoNear command
      

      Show
      1) prepare collection (mydb) db.timezone.ensureIndex({'shp':'2dsphere'}) 2) insert sample doc into "timezone" collection curl -sSL https://gist.github.com/jaymecd/71224330eaf6bfbb5676/raw/tzdoc.json | mongoimport -d mydb -c timezone --upsert 3) run command w/o uniqueDocs - see warning db.timezone.aggregate([ { $geoNear: { near: { type: "Point", coordinates: [ -84.198026746273, 39.89626511522 ] }, spherical: true, maxDistance: 50002, distanceField: "dist" } }, { $limit: 2 }, { $sort: { pos: 1, dist: 1 } }, { $match: { pos: 1 } }, { $project: { _id: 0, iso: "$cco" } }, { $limit: 1 } ]); 4) check logs and find warning 2015-04-01T11:21:15.344+0000 [conn72] warning: mydb.timezone: ignoring deprecated uniqueDocs option in geoNear command

      Description

      $geoNear pipeline within aggregate command always logs a warning about deprecated option "uniqueDocs" (see below), even if that option has never been set or used.

      mongodb.log:

      warning: mydb.timezone: ignoring deprecated uniqueDocs option in geoNear command
      

      As I get right, aggregation command calls first GeoNear command with always set "uniqueDocs" option.

      See https://github.com/mongodb/mongo/blob/r2.6.9/src/mongo/db/pipeline/document_source_geo_near.cpp#L139

        Attachments

          Activity

            People

            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: