<connectionStrings>
<!--read from the primary library, the latest data is displayed immediately-
<add name= "pattayadbconnection" connectionstring= "Mongodb://username:[email protected],ip2,ip3,ip4/dbname? Replicaset=rs_main&readpreference=primary"/>
<!--read from secondary library-
<add name= "Pattaya.ProductMongoDbProvider.ProductDB" connectionstring= "Mongodb://username:[email protected], ip2,ip3,ip4/dbname?replicaset=rs_main&readpreference=secondarypreferred"/>
<!--no readpreference parameter is write-only, do not read--
<add name= "pattayamallhistoryconnection" connectionstring= "Mongodb://username:[email protected],IP2,IP3,IP4/ Dbname?replicaset=rs_main "/>
</connectionStrings>
Note: & in HTML is represented by &
This article is from the "Legendary Library sub" blog, please be sure to keep this source http://chason.blog.51cto.com/9078447/1616536
MongoDB Connection String URI format¶