Closed phavekes closed 1 month ago
5 gebruikers hebben wel een linked account, maar geen subjectId of eppn:
db.users.find({ "linkedAccounts.schacHomeOrganization": { $exists: true, $ne: null, $ne: "" }, "linkedAccounts.eduPersonPrincipalName": { $exists: false }, "linkedAccounts.subjectId": { $exists: false } }).count();
Om deze accounts te ont-linken:
db.users.updateMany(
{
"linkedAccounts.schacHomeOrganization": { $exists: true, $ne: null, $ne: "" },
"linkedAccounts.eduPersonPrincipalName": { $exists: false },
"linkedAccounts.subjectId": { $exists: false }
},
{
$set: { "linkedAccounts": [] } // Maak het linkedAccounts object een lege array
}
)
Updated the test database! 2 users affected. Did not do acc or prod (yet)!
For linked accounts, a user can only have a subjectID (eg Leidenuniv). SubjectID is more reliable than eppn, so we should prefer this.