Judging by reading through MongoDB documentation, there is no equivalent of sql-like statement
SELECT 'field1' as 'a', 'field2' as 'b' ....
but because I am in need of such feature, I hope that I missed something.
What is the common practice for dealing with this problem?
The most common approach is to make a mapping layer in your application to take in a set of fields and then map them to what your application needs.
You are correct that there is not
ASprojection built into MongoDB at all.I believe you could accomplish this with the aggregation however:
So yea, I would stick to writing a mapping class in the app.