How do I connect if the password contains an @ sign?

mongodb,mongoose,linux,ubuntu

I get: Config error: Error: Username containing an unescaped at-sign How do I escape it? Should it work if I change it to %40? Resolve:

Simply Use "mongodb://username:"+encodeURIComponent("p@ssword")+"@localhost:27017/database"

Or

Replace the @ with %40 and it will work :)

Ref: Github

Có thể bạn đã miss một số snippets code

mongoose connect express

mongoose connect express

How do I connect if the password contains an @ sign?

I get: Config error: Error: Username containing an unescaped at-sign How do I escape it? Should it work if I change it to %40?

Mongodb - Query through an array of objects by a specific key

Mongodb - Query through an array of objects by a specific key