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
functiontest(){varthat=this;//currently logged in as a user with role = '_admin'this.DB.#("batman","pwd",{metadata: {roles: ['aaa','bbb']}}).then(function(r){console.log("Create user: "+r.ok);returnthat.DB.putUser("batman",{metadata: {roles: ['ccc']}})}).then(function(r){console.log("Modified user: "+r.ok);//Modified user: truereturnthat.DB.getUser("batman");}).then(function(r){console.log("Resulting roles: "+r.roles);//Resulting roles: ccc,bbbreturnr;}).catch(console.log);}}
I was expecting the resulting log to indicate that the resulting role was 'ccc', however, it looks like the first element of the array was replaced by the first element of the new array, but the rest of the array remained unchanged.
How do I go about removing the rest of the roles other than with a: {role: ["","",......]}?
As a side note, how do I delete a user? Is there a deleteUser(name, [callback]) or equivalent?
Thanks for your input!
The text was updated successfully, but these errors were encountered:
ptitjes
added a commit
to ptitjes/pouchdb-authentication
that referenced
this issue
Nov 14, 2017
I tried the following:
I was expecting the resulting log to indicate that the resulting role was 'ccc', however, it looks like the first element of the array was replaced by the first element of the new array, but the rest of the array remained unchanged.
How do I go about removing the rest of the roles other than with a:
{role: ["","",......]}
?As a side note, how do I delete a user? Is there a
deleteUser(name, [callback])
or equivalent?Thanks for your input!
The text was updated successfully, but these errors were encountered: