Fix processing order for mongo_impl