Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
SERVER-47773 Error consistently when tailable cursors and $near are u…
- Loading branch information
Showing
4 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
// @tags: [requires_capped] | ||
// | ||
// Tests that combine $geoNear and tailable cursors. | ||
// | ||
(function() { | ||
"use strict"; | ||
|
||
let cmdRes; | ||
const collName = 'geo_near_tailable'; | ||
const cappedCollName = 'geo_near_tailable_capped'; | ||
|
||
// Avoid using the drop() shell helper here in order to avoid "implicit collection recreation" | ||
// which can happen when this test runs in certain passthroughs. For details, see | ||
// "jstests/libs/override_methods/implicitly_shard_accessed_collections.js". | ||
db.runCommand({drop: collName}); | ||
db.runCommand({drop: cappedCollName}); | ||
assert.commandWorked(db.createCollection(collName)); | ||
assert.commandWorked(db.createCollection(cappedCollName, {capped: true, size: 10000})); | ||
|
||
// Error when tailable option is used with NEAR. | ||
cmdRes = db.runCommand({find: collName, filter: {a: {$geoNear: [1, 2]}}, tailable: true}); | ||
assert.commandFailedWithCode(cmdRes, ErrorCodes.BadValue); | ||
cmdRes = db.runCommand({find: cappedCollName, filter: {a: {$geoNear: [1, 2]}}, tailable: true}); | ||
assert.commandFailedWithCode(cmdRes, ErrorCodes.BadValue); | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters