In my business simulation game I have a mongoDB collection where each document represents a 'game group'. I use the _id of a 'game group' with the prefix '__' (because numbers are not allowed at the beginning of a group name) to add users to such a group via
Roles.addUsersToRoles(user, role, group);
See an example of a user and his groups and roles in the group in the screenshot:
But this works in my case just fo 25 array entries. If I want to add the shown user e.g. to another group, I got the error
errmsg: 'WiredTigerIndex::insert: key too large to index, failing 1051 '
from mongoDB. It seems that adding users to groups is limited because the mongoDB index on the roles field doesn't support more entries. I tried this with shorter group names like 'group1', 'group2' and so on and was able to insert 35 entries. But a limit is also there.
Maybe there is a connection to the issue #246 ?
In an post a similar error in context to mongoDB and a workaround with
mongod --setParameter failIndexKeyTooLong=false
is mentioned but not recommended.
I am using Meteor 1.5.2.2, alanning roles 1.2.16 and mongo 3.2.15
I found the mistake ... it was my fault. Inadvertently I have set an string index for the role field in the schema of the user collection. Problem solved.
In my business simulation game I have a mongoDB collection where each document represents a 'game group'. I use the _id of a 'game group' with the prefix '__' (because numbers are not allowed at the beginning of a group name) to add users to such a group via
Roles.addUsersToRoles(user, role, group);
See an example of a user and his groups and roles in the group in the screenshot:![bildschirmfoto 2017-10-22 um 18 22 17](https://user-images.githubusercontent.com/5546940/31863963-fef67b84-b755-11e7-980e-88cc84181b1b.png)
But this works in my case just fo 25 array entries. If I want to add the shown user e.g. to another group, I got the error
errmsg: 'WiredTigerIndex::insert: key too large to index, failing 1051 '
from mongoDB. It seems that adding users to groups is limited because the mongoDB index on the roles field doesn't support more entries. I tried this with shorter group names like 'group1', 'group2' and so on and was able to insert 35 entries. But a limit is also there.
Maybe there is a connection to the issue #246 ?
In an post a similar error in context to mongoDB and a workaround with
mongod --setParameter failIndexKeyTooLong=false
is mentioned but not recommended.I am using Meteor 1.5.2.2, alanning roles 1.2.16 and mongo 3.2.15
Do I something wrong? Is there a solution?