[SERVER-17835] Aggregation geoNear deprecated uniqueDocs warning Created: 01/Apr/15  Updated: 17/Mar/16  Resolved: 01/Apr/15

Status: Closed
Project: Core Server
Component/s: Aggregation Framework, Geo
Affects Version/s: 2.6.9
Fix Version/s: 3.0.3, 3.1.1

Type: Bug Priority: Minor - P4
Reporter: Nikolai Zujev Assignee: Sam Kleinman (Inactive)
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Backwards Compatibility: Fully Compatible
Operating System: Linux
Backport Completed:
Steps To Reproduce:

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

Participants:

 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



 Comments   
Comment by Githook User [ 20/Apr/15 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: SERVER-17835: fix complie for logging

(cherry picked from commit 3cf0c18aa2c56949fda47ab35570489d68965370)
Branch: v3.0
https://github.com/mongodb/mongo/commit/5346a2f303ecea86efc2e1ff92720807beb66e11

Comment by Githook User [ 20/Apr/15 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: SERVER-17835: geoNear pipeline stage no longer needs to specify uniqueDocs

(cherry picked from commit e42605bba71b9fc99b9ce275f46302df98f82670)
Branch: v3.0
https://github.com/mongodb/mongo/commit/c62eee2f4cc7a98f33ac81b7d21c2e94bebf2d55

Comment by Githook User [ 01/Apr/15 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: SERVER-17835: fix complie for logging
Branch: master
https://github.com/mongodb/mongo/commit/3cf0c18aa2c56949fda47ab35570489d68965370

Comment by Githook User [ 01/Apr/15 ]

Author:

{u'username': u'tychoish', u'name': u'Sam Kleinman', u'email': u'samk@10gen.com'}

Message: SERVER-17835: geoNear pipeline stage no longer needs to specify uniqueDocs
Branch: master
https://github.com/mongodb/mongo/commit/e42605bba71b9fc99b9ce275f46302df98f82670

Comment by Ramon Fernandez Marina [ 01/Apr/15 ]

Thanks for your report nikolai@cluelist.com; this does look like a bug, so we're looking into it. Feel free to watch the ticket for updates.

Generated at Thu Feb 08 03:45:44 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.