Skip to content


Subversion checkout URL

You can clone with
Download ZIP


Console.logs automatically with message regarding {safe:true } #77

jockster opened this Issue · 18 comments

10 participants


When requring mongoskin:

=  Please ensure that you set the default safe variable to one of the                  =
=   allowed values of [true | false | {j:true} | {w:n, wtimeout:n} | {fsync:true}]     =
=   the default value is false which means the driver receives does                    =
=   return the information of the success/error of the insert/update/remove            =
=                                                                                      =
=   ex: new Db(new Server('localhost', 27017), {safe:true})                            =
=                                                                                      =
=                           =
=                                                                                      =
=  The default of false will change to true in the near future                         =
=                                                                                      =
=  This message will disappear when the default safe is set on the driver Db           =

Yep getting this as well.


Figured out that I can do this to silent the above shown message, but it appears that strict mode then get's activated which isn't working for me:

db = mongo.db("localhost:27017?auto_reconnect=true",
  database: "testing"
  safe: true
@jockster jockster closed this
@jockster jockster reopened this

I think @christkv want everyone to use the safe mode. mongodb/node-mongodb-native@1b81574


I am also having this exact same problem. Does anyone know how I can fix this?

I have tried changing this:
var db = new Db(Config.dbName, new Server("", 27017, {}), {});

var db = new Db(Config.dbName, new Server("", 27017, {}), {safe:false/true});

After making the changes above it does the following:

ERROR: (Thu Oct 11 2012 13:45:55 GMT-0400 (EDT)): {}

Can anyone help?


Also experiencing this problem despite adding {safe:true} to Server constructor calls. It is still dropping those 14 lines of useless warnings for every call to the client. Rather annoying.


@fahmad91 , I got it to work because of what @jockster said about strict mode.

var db = new Db(Config.dbName, new Server("", 27017, {safe: true}, {strict: false} ));

Worked for me anyways


@coryarmbrecht Don't you have a syntax error? You didn't close all your brackets.


Oops. That was just from me editing the line to post here. In my case,{safe: true}, {strict: false} worked.


Awesome,that worked for me too. Thanks for posting.


I tried the above solution but the warning message is still printed for me. Here's what I ended up writing:

var db = new Db(dbName, new Server("", 27017, {safe:true}), {strict:false});

Is this fine?



var mongo = require("mongoskin")
  , db = mongo.db(config.db.url, {safe:true}) // config.db.url = '

I write like this, and make sure every db action should be {safe: true}. No setting about {strict:false}, and no warnings anymore. (mongoskin version "0.4.4") Hope it helps.


@Heliumchen didnt work man! And I'm just using the find operator.


In 1.2 the preferred way is to connect with mongoclient (going forward)

For pre 1.2 if you want to set a default safe do

new Db('mydb', new Server('localhost', 27017), {safe:true});

// or

For anyone still having these issues, combining both safe:true & strict: false seems to do the trick, at least for me. Example: (coffeescript)

db = require("mongoskin").db(config.get '',
  database: config.get 'db.database'
  safe: true
  strict: false

Is there a sure way to solve this problem? I get this notice on my console too and I have done everything mentioned in this thread.

var dbOptions: {
'auto_reconnect': true
, 'poolSize' : 1
, w : 1
, safe : true
, strict: false
var db = mongoskin.db((config.dbName || 'localhost:27017/test'), dbOptions);

Can someone tell me what I am doing wrong? Thanks


Shouldn't you pass the host as first argument and then database in the second arg. as a part of the dbOptions variable?

@jockster jockster closed this

You mean something like below?

db = require("mongoskin").db(config.get(''), {
  database: config.get('db.database'),
  safe: true,
  strict: false
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.