Displaying INT32 as Text

I could not find the answer via the documentation or via search in the forums, so apologies if I missed it…

Is it possible to convert an INT32 to a text string in Mongo Atlas Charts, using the ChartType = Table? I am not looking to convert 1 to “1”, but rather 1 to “Bob”.

Longer story:
I stored some values in the DB as an .NET Enum, which by default is an int32. I am aware that I could store that value as a string in mongo, but for whatever reason, I did not. So I am looking to convert that INT into human readable text for those viewing the chart.

For now I put a little legend in the chart description area and colored the fields according to the enum/int value, but a conversion to string would be fantastic.

Yes you can do this. Create a calculated field that uses the $switch aggregation.

Alternatively you could store the mappings between the codes and strings in a different collection, and add a lookup field to do the conversion.

Tom