且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Cosmos DB-使用Python插入多个记录

更新时间:2023-02-14 12:20:29

您是正确的,因为您可以通过存储过程插入多个文档.

You're correct in that you can insert multiple documents via a stored procedure.

但是:没有api调用可一次插入多个文档.您必须为每个文档插入执行一次调用(无论是从您的应用程序还是从存储过程完成).

However: There are no api calls to insert multiple documents at once. You must execute one call per document insert (whether done from your app, or from a stored procedure).

存储过程方法将给您带来较少的调用集(基本上是单个调用),并且是事务性的(全部或全部不成功).

The stored procedure approach will give you a less-chatty set of calls (essentially a single call), and be transactional (all or none succeed).