User-Facing Backend : addUser method is not working

Hi,
I have passed 3 out of 4 tests.

This is my code for addUser (it does not work)

I just do not know whats wrong with it. Please help. I’m stuck.

Thanks in advance

Hi @Rashad_Bayram, :wave: .
While I am trying to figure out what went wrong, can you try again using the following syntax?

      await users.insertOne({ ...userInfo }, {w: "majority"})

In case you have any doubts, please feel free to reach out to us.

Thanks and Regards.
Sourabh Bagrecha,
Curriculum Services Engineer

The symptom is that your getUser does not return the appropriate user, hence the TypeError.

This means getUser is wrong or addUser is wrong.

Despite using the long syntax versus JS destructuring syntax, I do not see anything fundamentally wrong with your addUser. Please share the getUser code.

1 Like

I change the syntax as you suggested.

@steevej you were right. my getUser was not there at all. i missed it. now it works.

Thank you. problem solved.

1 Like