for (let i = 0; i < 10000; i++) db.coll.insertOne({ a: ((Math.random() * 1000) | 0), b: ((Math.random() * 1000) | 0) }); db.coll.createIndex({a:1}) db.coll.createIndex({b:1})
Then explain in Compass for a query like
{$or:[{a:200},{b:300}]}
will result in a “Shard results differ” warning message in the explain output because the server performs two index scans using different indexes, even though sharding is not involved.