From cd4be93a02bfce1c2bbdc0e7cb10a0404eec0bba Mon Sep 17 00:00:00 2001 From: "Scott R. Parish" Date: Mon, 1 Mar 2010 08:27:59 -0600 Subject: [PATCH] tutorial: update connection section for new ConnectOpts stuff --- tutorial.md | 13 ++++++++++--- 1 file changed, 10 insertions(+), 3 deletions(-) diff --git a/tutorial.md b/tutorial.md index 3553e14..53a603a 100644 --- a/tutorial.md +++ b/tutorial.md @@ -56,12 +56,19 @@ Making A Connection ------------------- 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 -> import Network -> con <- connectOnPort "127.0.0.1" (Network.PortNumber 666) +> import Network +> 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 ------------------