tutorial: update connection section for new ConnectOpts stuff

This commit is contained in:
Scott R. Parish 2010-03-01 08:27:59 -06:00
parent 97a1088581
commit cd4be93a02

View file

@ -56,12 +56,19 @@ Making A Connection
------------------- -------------------
Open up a connection to your DB instance, using the standard port: Open up a connection to your DB instance, using the standard port:
> con <- connect "127.0.0.1" > con <- connect "127.0.0.1" []
or for a non-standard port or for a non-standard port
> import Network > import Network
> con <- connectOnPort "127.0.0.1" (Network.PortNumber 666) > con <- connectOnPort "127.0.0.1" (Network.PortNumber 666) []
By default mongoDB will try to find the master and connect to it and
will throw an exception if a master can not be found to connect
to. You can force mongoDB to connect to the slave by adding SlaveOK as
a connection option, eg:
> con <- connect "127.0.0.1" [SlaveOK]
Getting the Databases Getting the Databases
------------------ ------------------