MCPcopy Index your code
hub / github.com/mongodb/mongo-python-driver / gen_ordered

Method gen_ordered

pymongo/asynchronous/bulk.py:217–229  ·  view source on GitHub ↗

Generate batches of operations, batched by type of operation, in the order **provided**.

(self)

Source from the content-addressed store, hash-verified

215 self.ops.append((_DELETE, cmd))
216
217 def gen_ordered(self) -> Iterator[Optional[_Run]]:
218 """Generate batches of operations, batched by type of
219 operation, in the order **provided**.
220 """
221 run = None
222 for idx, (op_type, operation) in enumerate(self.ops):
223 if run is None:
224 run = _Run(op_type)
225 elif run.op_type != op_type:
226 yield run
227 run = _Run(op_type)
228 run.add(idx, operation)
229 yield run
230
231 def gen_unordered(self) -> Iterator[_Run]:
232 """Generate batches of operations, batched by type of

Callers 1

executeMethod · 0.95

Calls 2

_RunClass · 0.90
addMethod · 0.80

Tested by

no test coverage detected