mongodb: should i always use the 'safe' option on updates

后端 未结 3 1157
名媛妹妹
名媛妹妹 2021-02-08 11:03

when dealing with mongodb, when should i use the {safe: true} on queries?

Right now I use the \'safe\' option just to check if my queries were inserted or updated succes

3条回答
  •  说谎
    说谎 (楼主)
    2021-02-08 11:35

    Safe is only necessary on writes, not reads. Queries are only reads.

提交回复
热议问题