Quantcast
Channel: StackExchange Replication Questions
Viewing all articles
Browse latest Browse all 17268

Why does MongoDB give me the cannot use 'w' > 1 when a host is not replicated Error message?

$
0
0

Here is the information about my development environment: •Microsoft Visual Studio Community 2015 •.NET Framework 4.6 •ASP.NET MVC assembly System.Web.Mvc Version=5.2.3.0 •MongoDB.Driver 2.0.1.27 •Mongodb 3.0.6

From MongoDB client using DOS command prompt, I got the following:

C:\Program Files\MongoDB\Server\3.0\bin>mongo
 MongoDB shell version: 3.0.6
 connecting to: test
 > use foo
 switched to db foo
  > db.runCommand( { getLastError: 1, w: 2, wtimeout:5000 } )
 {
       "connectionId" : 6,
       "n" : 0,
        "badGLE" : {
                "getLastError" : 1,
                "w" : 2,
                "wtimeout" : 5000
               },
           "ok" : 0,
            "errmsg" : "cannot use 'w' > 1 when a host is not replicated",
           "code" : 2
       }
       > 

-Is there something wrong with the way I configured mongoDB database on my development computer? -When I read the error message: "cannot use 'w' > 1 when a host is not replicated" it seems to me that mongoDB by default forces developers to have replica set. Is that correct?

I'm only using MongoDB for development on my local computer. I don't want to be forced to use a replica set. Is there any way to resolve the "cannot use 'w' > 1 when a host is not replicated" error message?


Viewing all articles
Browse latest Browse all 17268

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>