summaryrefslogtreecommitdiff
path: root/jstests/core/explain_db_mismatch.js
blob: 13d54cae77f7f970c4920af38d8a15e0466515e1 (plain)
1
2
3
4
5
6
7
// Ensure that explain command errors if the inner command has a $db field that doesn't match the
// outer command.
(function() {
    assert.commandFailedWithCode(
        db.runCommand({explain: {find: 'some_collection', $db: 'not_my_db'}}),
        ErrorCodes.InvalidNamespace);
}());