> var duplicateRoles = [ "a", "a", "a", "a", ... "a" ];
> db.runCommand(
);
> db.runCommand(
{ grantRolesToRole: "empty", privileges: [], roles: duplicateRoles });
In both cases, when the duplicateRoles array becomes very large (>16mb) we get an error and a stack trace from mongo:
Assertion: 10334:BSONObj size: 19888945 (0x12F7B31) is invalid.
Instead, I would expect one of two things: a graceful failure with a nice error message, or a successful insert, since the linked roles will (in theory) be de-duped before the parent role is stored in the db.
- duplicates
-
SERVER-11525 Provide nicer message when converting JS to BSON if too big
- Closed