Mongo Bulk Insert across multiple collections

后端 未结 1 522
花落未央
花落未央 2021-01-04 08:33

I see that mongo has bulk insert, but I see nowhere the capability to do bulk inserts across multiple collections. Since I do not see it anywhere I\'m assuming its not avail

相关标签:
1条回答
  • 2021-01-04 09:15

    You are correct in that the bulk API operates on single collections only.

    There is no specific reason but the APIs in general are collection-scoped so a "cross-collection bulk insert" would be a design deviation.

    You can of course set up multiple bulk API objects in a program, each on a different collection. Keep in mind that while this wouldn't be transactional (in the startTrans-commit-rollback sense), neither is bulk insert.

    0 讨论(0)
提交回复
热议问题