Mongodb authentication [duplicate]
问题 This question already has answers here : MongoDB GridFs with C#, how to store files such as images? (3 answers) Closed 6 years ago . How do I use authentication with mongodb via the official c# driver? I can't find any API methods to authenticate, other than internal members. 回答1: Authentication credentials should be specified in your connection string, using the following connection string format: mongodb://[username:password@]hostname[:port][/[database][?options]] See full details here in