summaryrefslogtreecommitdiff
path: root/jstests/core/index/useindexonobjgtlt.js
blob: bcdf36f3279f6bf67f8c4c52caee815649ec6b7a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
// @tags: [requires_fastcount]

let t = db.factories;
t.drop();
t.insert({name: "xyz", metro: {city: "New York", state: "NY"}});
t.createIndex({metro: 1});

assert(db.factories.find().count());

assert.eq(1, db.factories.find({metro: {city: "New York", state: "NY"}}).hint({metro: 1}).count());

assert.eq(1, db.factories.find({metro: {$gte: {city: "New York"}}}).hint({metro: 1}).count());