So I need a custom field calculated in MongoDB as follows
if( field1 ==\"A\") ->customfield=10 else if(field1 ==\"B\" )->customfield=20 else (field1 ==\"
MongoDB 3.4 has a new thing called $switch for this exact thing!
$switch
$switch: { branches: [ { case: , then: }, { case: , then: }, ... ], default: }
https://docs.mongodb.com/manual/reference/operator/aggregation/switch/