[DOCS-597] Corrections for geospatial examples in "within" section of "operators" Created: 11/Oct/12  Updated: 10/Jan/13  Resolved: 08/Jan/13

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug Priority: Major - P3
Reporter: Rasmus Weber-Esmann Assignee: Kay Kim (Inactive)
Resolution: Duplicate Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by DOCS-934 Multiple $centerSphere examples are w... Closed
Participants:
Days since reply: 11 years, 5 weeks, 6 days ago

 Description   

At http://docs.mongodb.org/manual/reference/operators/#_S_within code is given to find geospatial data within a circle. The following code is given:
db.collection.find( { location: { $within:

{ $circle: [ center, radius }

} } );

A "]" (without quotes) is missing. Also should $circle be changed to $center?

Using the dataset provided for Chris Harris training session at Kamstrup in Denmark this week i get the following results:

> db.tweets.find( {"geo.coordinates": {$within: {$center: [[37.75, -122.42],5]} } } ).count()
13

> db.tweets.find( {"geo.coordinates": {$within: {$circle: [[37.75, -122.42],5]} } } ).count()
Mon Oct 08 14:40:53 uncaught exception: count failed: {
"errmsg" : "exception: unknown $within information :

{ $circle: [ [ 37.75, -122.42 ], 5.0 ] }

, a shape must be specified.",
"code" : 13058,
"ok" : 0



 Comments   
Comment by Sam Kleinman (Inactive) [ 10/Jan/13 ]

rwe@kamstrup.dk: Agreed. Sorry I didn't make the duplicate link explicit. We're working on resolving this later this week, I just closed this ticket for clarity.

Thanks for the attention here!

Comment by Rasmus Weber-Esmann [ 10/Jan/13 ]

Only half of the issue has been resolved.

There is still the case of the missing "]" (without quotes).
On http://docs.mongodb.org/manual/reference/operators/#_S_within in the circles example it says:

db.collection.find( { location: { $within:

{ $center: [ center, radius }

} } );

It should instead be:

db.collection.find( { location: { $within:

{ $center: [ center, radius ] }

} } );

Best regards

Kamstrup A/S <http://www.kamstrup.com>
Rasmus Lauszus Weber-Esmann
Software Developer
Technology, Software

Kamstrup A/S
Industrivej 28
DK-8660 Skanderborg
Tel: +45 89 93 10 00
Fax: +45 89 93 10 01
Dir: +45 89 93 10 42
Mob: +45 20 81 87 46
E-mail: rwe@kamstrup.dk
Web: www.kamstrup.com

Comment by Rasmus Weber-Esmann [ 10/Jan/13 ]

Only half of the issue has been resolved.

There is still the case of the missing "]" (without quotes).
On http://docs.mongodb.org/manual/reference/operators/#_S_within in the circles example it says:

db.collection.find( { location: { $within:

{ $center: [ center, radius }

} } );

It should instead be:

db.collection.find( { location: { $within:

{ $center: [ center, radius ] }

} } );

Comment by Kay Kim (Inactive) [ 08/Jan/13 ]

Fixed in DOCS-725

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