Files
mongo/jstests/core/client_metadata_ismaster.js
2016-08-04 17:29:34 -04:00

13 lines
460 B
JavaScript

// Test that verifies client metadata behavior for isMaster
(function() {
"use strict";
// Verify that a isMaster request fails if it contains client metadata, and it is not first.
// The shell sends isMaster on the first connection
var result = db.runCommand({"isMaster": 1, "client": {"application": "foobar"}});
assert.commandFailed(result);
assert.eq(result.code, ErrorCodes.ClientMetadataCannotBeMutated, tojson(result));
})();