Can I somehow add custom field with static (not computed) value?
I want to prepare objects before send and I need to remove some fields with internal information and
Note that $literal was implemented in Mongo 2.6. So now you can simply write:
db.test.aggregate( {$project: {_id: 0, data: 1, entity_id: {$literal: 54}}})
See $literal.