[SERVER-9799] make tailable cursor work with 2dsphere $geoWithin query Created: 28/May/13 Updated: 25/Jun/15 Resolved: 28/May/15 |
|
| Status: | Closed |
| Project: | Core Server |
| Component/s: | Querying |
| Affects Version/s: | 2.4.3 |
| Fix Version/s: | None |
| Type: | Improvement | Priority: | Major - P3 |
| Reporter: | Aaron Heckmann | Assignee: | Unassigned |
| Resolution: | Done | Votes: | 2 |
| Labels: | None | ||
| Remaining Estimate: | Not Specified | ||
| Time Spent: | Not Specified | ||
| Original Estimate: | Not Specified | ||
| Participants: |
| Description |
|
On a capped collection with a 2dsphere index, a tailable $near or $geoWithin query stops at the end of the current result set and does not continue returning new inserted documents. Originally reported here. Reproduced in Node.js as well as the mongo shell. |
| Comments |
| Comment by J Rassi [ 28/May/15 ] |
|
A query with the tailable flag enabled will always perform a collection scan instead of using an index. See the documentation on tailable cursors for more information: <http://docs.mongodb.org/manual/tutorial/create-tailable-cursor/>. Since $near queries must use a geospatial index, they are disallowed with the tailable option. On the other hand, $geoWithin queries are allowed to be used with the tailable option, but it is expected behavior for a tailable cursor to return an empty batch immediately without waiting for further results if the "Await Data" flag is not set. As such, I'm closing this ticket with resolution "Works as Designed". ~ Jason Rassi |