" MongoServerError[TypeMismatch]: PlanExecutor error during aggregation :: caused by :: $add only supports numeric or date types, not string" error is returned for the next aggregation, although “birth year” is of Int32 type. db.trips.aggregate( {$project: {_id:0, "birth year":1, "newColumn": {$add: [ "$birth year",1 ] } } } )
Based on the sample_training database provided by MongoDB.
Now there can be discussions on whether or not to have a consistent type for this field, how to update them and how to enforce consistency to a set of rules if that is desired.