Count values in array of objects

could somebody please give an example for that? I’m all new to Mongo…