Show
(function() {
"use strict";
db.c.drop();
db.c.createIndex({a: "2dsphere", b: 1});
db.c.createIndex({b: 1});
db.c.insert({a: {type: "Point", coordinates: [-79.88635540008511, 32.76497530165182]}, b: 10});
db.c.insert({a: [-79.88635540008511, 32.76497530165182], b: 12});
var geoPredicate = {
$and: [
{b: {$gte: 6}},
{
a: {
$within: {
$polygon: [
[-79.97488975524868, 32.76497530165182],
[-79.88635540008511, 32.76497530165182],
[-79.88635540008511, 32.72617288558777],
[-79.97488975524868, 32.72617288558777]
]
}
}
},
{
a: {
$within: {
$centerSphere:
[[-79.86978928637699, 32.75469246872076], 0.000757002271006813]
}
}
}
]
};
// First invocation should succeed and generate a plan cache entry.
assert.eq(2, db.c.find(geoPredicate).itcount());
// Second invocation is pulled from the cache and trips the verify()!
assert.eq(2, db.c.find(geoPredicate).itcount());
})();