These are chat archives for Automattic/mongoose

6th
May 2016
Petru Isfan
@petruisfan
May 06 2016 08:58
Hello! Can anyone tell me if mongoose supports the option flag slaveOk? I am trying to connect to a slave mongodb server, and it's trowing an error: "not master and slaveOk=false"
Petru Isfan
@petruisfan
May 06 2016 10:25
Ok, so I fount that connect receives the db option, which is sent directly to the native driver
and the native driver sends the db option to the db constructor
which has the boolean flag slaveOk
pdiogo
@PedroMD
May 06 2016 10:27
ey everybody! what is the best way to automatically insert a document whenever mongoose creates the collection (when there is 0 documents)? it looks like it creates the collection right after the model is defined and my server launches - now I just need it to verify if it contains 0 documents to then insert a specific one...
Petru Isfan
@petruisfan
May 06 2016 10:27
but setting options: { db: {slaveOk: true } } does not remove the error