User Managment - DeleteUser() [Solved]

I am stuck trying to pass the UserTest ticket. All the test cases have passed except for the last one “DeleteUser” I am getting below error:

“Should not find any sessions after deleting a user. deleteUser() method needs to remove the user sessions”

I know that before deleting the user, I need to execute the “deleteUserSessions” with the user_id, I already have the find to get the user_id based on the email but I am not able to cast it to String. Any help here?


The user_id in the sessions collection is the user’s email; see the sessions collection data and its structure/fields in the Compass. So, pass the email string as the argument to the deleteUserSessions method.

1 Like

Hi Prasad,

I have already checked session and users collections in compass but did not get that relationship :frowning: . Man your rock!!! This made the trick, I did not even needed the find statement.

Thanks a lot :slight_smile:

1 Like