Re: set the default safe variable on the driver Db

140 views
Skip to first unread message

Gianfranco

unread,
Oct 22, 2012, 11:46:26 AM10/22/12
to mongod...@googlegroups.com
In Mongoose when you define the schema you add an option to set safe to true:

  1. var safe = true;
  2. new Schema({ .. }, { safe: safe });

Here is the documentation you are looking for:

On Monday, October 22, 2012 3:20:10 PM UTC+1, mic0331 wrote:
hello,

since last update when i start node i have this message ;

========================================================================================
=  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 not                =
=   return the information of the success/error of the insert/update/remove            =
=                                                                                      =
=   ex: new Db(new Server('localhost', 27017), {safe:false})                           =
=                                                                                      =
=   http://www.mongodb.org/display/DOCS/getLastError+Command                           =
=                                                                                      =
=  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           =
========================================================================================

here is my config setup :

module.exports = mongoose = require('mongoose');
mongoose.connect('mongodb://localhost/mydb/?safe=true');
module.exports = Schema = mongoose.Schema;

Do I make something wrong ?  How do I specify "safe=True" ?

Thanks for letting me know.

Aaron Heckmann

unread,
Oct 22, 2012, 1:08:43 PM10/22/12
to mongod...@googlegroups.com
You didn't do anything wrong. Which mongoose version?
> --
> You received this message because you are subscribed to the Google
> Groups "mongodb-user" group.
> To post to this group, send email to mongod...@googlegroups.com
> To unsubscribe from this group, send email to
> mongodb-user...@googlegroups.com
> See also the IRC channel -- freenode.net#mongodb



--
Aaron
@aaronheckmann

mic0331

unread,
Oct 27, 2012, 12:22:55 PM10/27/12
to mongod...@googlegroups.com
Any idea on this subject?
Reply all
Reply to author
Forward
0 new messages