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

Method insert_and_aggregate

test/test_session.py:1256–1263  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

1254 cursor.close()
1255
1256 def insert_and_aggregate():
1257 cursor = (collection.aggregate([], batchSize=1)).batch_size(1)
1258 for _ in range(5):
1259 # Advance the cluster time.
1260 collection.insert_one({})
1261 next(cursor)
1262
1263 cursor.close()
1264
1265 def aggregate():
1266 (collection.aggregate([])).to_list()

Callers

nothing calls this directly

Calls 5

nextFunction · 0.90
batch_sizeMethod · 0.45
aggregateMethod · 0.45
insert_oneMethod · 0.45
closeMethod · 0.45

Tested by

no test coverage detected