python ruby-programming-language Smalltalk Vue.js Knockoutjs TypeScript JavaScript, OOPs JavaScript Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 8,7,6,5,4 and 2 Interview Questions and Answers Angular 4 Angular 2 AngularJs 1.x NodeJs Perl Programming R Programming RequireJs Rust Programming Backbonejs closure programming language go-programming-language kotlin-programming-language
How to create database in MongoDB?

MongoDB Connection String UserName Password C#

According to MongoDB docs,

“The mongodb  connection string username and password are optional. If username and password are specified in connection string, the client will attempt to log in to the specific database using the same credentials after connecting to the MongoDB instance.”

The mongodb connection string URL's standard format and used to connect to MongoDB database server.

mongodb://[username:[email protected]]host1[:port1][,host2[:port2],...[,hostN[:portN]]][/[database][?options]]

Optional Parameters:
·         :port1,
·         hostX,
·         :portX ,
·         username:[email protected]

Required Parameters:
·         mongodb://,
·         host1

The default value of “:port1”, “portX”, and “:portX” is "27017"

Example, the following MongoDB hosts on port 27017 and on port 2500

The mongodb connection string looks like,

Stayed Informed - Why use MongoDB in MVC .Net?

I hope you are enjoying with this post! Please share with you friends. Thank you!!

Hi there! Welcome to my blog. My name is Anil Singh. I'm a author of this blog. For more detail about me, kindly refer to this link..
My Blogs - and
My Books - Interview Questions and Answers Books- Get Your Book in 15+ Digital Stores Worldwide..

You Might Also Like Powered by Blogger.
ASK Questions