Problem with insert_many in Mongodb
伊谢尔伦
伊谢尔伦 2017-06-10 09:48:04
0
1
1336

It is mentioned in the document that the parameters of insert_many do not have the check_keys parameter like insert. Although insert_many is controlled by the ordered parameter during insertion, it will not affect the remaining insertions due to the existence of errors and exception exits. However, this The problematic data is still not inserted.
How can I make insert_many also support non-checking? The meaning of the bypass_document_validation parameter is not very clear. If this parameter can be controlled, then if the default is False, it should not be checked from time to time.
If insert_many cannot ignore the check, then how can insert implement the ordered parameter? Thanks

伊谢尔伦
伊谢尔伦

小伙看你根骨奇佳,潜力无限,来学PHP伐。

reply all(1)
曾经蜡笔没有小新

The bypass_document_validation parameter is a new feature in MongoDB 3.2 that ignores the validator; in your operation, if the collection sets the validator, you can ignore the validator through this parameter and then insert it.

validator can be understood as a field verification, similar to a constraint function.

Please refer to:

https://docs.mongodb.com/mast...

The ordered parameter is inserted in the order in which the documents in the provided array are grouped. If set to true, if the insertion of the previous document fails, the insertion will stop.

Please refer to:

http://mongodb.github.io/node...

Love MongoDB! Have fun!

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template