Starting in MongoDB 4.4 you can use aggregation expressions in projections for find. For example, to flatten some fields in a document:
>>> client.t.t.find_one({}, {'windDirection': '$wind.direction.angle', 'windSpeed': '$wind.speed.rate'}) {'_id': ObjectId('5553a998e4b02cf7151190bf'), 'windDirection': 100, 'windSpeed': 3.1}
Unfortunately this does not work with pymongoarrow because it supplies its own custom projection:
>>> client.t.t.find_arrow_all({}, schema=Schema({'windDirection': int, 'windSpeed': float}), projection={'windDirection': '$wind.direction.angle', 'windSpeed': '$wind.speed.rate'}) <stdin>:1: UserWarning: Ignoring option 'projection' as it is not supported by PyMongoArrow pyarrow.Table windDirection: int64 windSpeed: double
We should add support for custom projections to find_arrow_all and friends.