monkey – Add PyMongoArrow APIs to PyMongo

Add PyMongoArrow APIs to PyMongo.

pymongoarrow.monkey.patch_all()

Patch all PyMongoArrow methods into PyMongo.

Calling this method equips the pymongo.collection.Collection classes returned by PyMongo with PyMongoArrow’s API methods. When using a patched method, users can omit the first argument which is passed implicitly. For example:

# Example of direct usage
df = find_pandas_all(coll.db.test, {'amount': {'$gte': 20}}, schema=schema)

# Example of patched usage
df = coll.db.test.find_pandas_all({'amount': {'$gte': 20}}, schema=schema)