You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Sep 4, 2024. It is now read-only.
When users are created, no userId attribute is being set. This is also not present in the current user model. This causes duplicate errors. Note that userId is different from the _id attribute, which is automatically generated by mongo. Mongo patterns generally suggest relying on _id.
As far as I can tell userId is currently only being used for ease of granting superadmin status via db.users.update({'userId': 6}, {$set: {'superadmin': true}}). However, this might cause confusion with _id.
Either we have to set up an autoincrementing userId attribute and set it with user creation or remove userId altogether.
On the live instance, it appears that userId is only set for the first 16 users, which is likely because of this issue.
The text was updated successfully, but these errors were encountered:
@spaceraccoon This was caused by a legacy mongo autoincrement package, recently dropped as a dependency. This problem should be resolved on ec2, as I dropped the index on userId (and dropped all other indexes created by this package). To resolve this on your local machine, you should run in the mongo shell:
use nhba
show tables
db.TABLENAME.getIndexes()
Given an index with tablenameId, you should drop that index (e.g.):
When users are created, no
userId
attribute is being set. This is also not present in the currentuser
model. This causes duplicate errors. Note thatuserId
is different from the_id
attribute, which is automatically generated by mongo. Mongo patterns generally suggest relying on_id
.As far as I can tell
userId
is currently only being used for ease of grantingsuperadmin
status viadb.users.update({'userId': 6}, {$set: {'superadmin': true}})
. However, this might cause confusion with_id
.Either we have to set up an autoincrementing
userId
attribute and set it with user creation or removeuserId
altogether.On the live instance, it appears that
userId
is only set for the first 16 users, which is likely because of this issue.The text was updated successfully, but these errors were encountered: