prepare_mongo_condition helper method