Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Completed
Categories Charts
Created by Guest
Created on Jun 20, 2020

Field value label alias/override

When building a chart it is currently to provide a label override. E.G. change the label from 'document.subdocument.field' to 'mylabel. There should also be an option to provide value aliases/label overrides; E.G. be able to alias an int field with value 0 to ''red". Imagine a document field "color" of type int, where int defines a color used by a client. In the charts these values 0/1/2/3 mean little as they do not describe the value; being able to provide an alias of 'red/blue/green/yellow' would make it more meaningful
  • ADMIN RESPONSE
    Oct 18, 2025
    This can be done with String Binning. The feature lets you put 1 or more strings into a category and assign a new name. If the original values are numbers, you will need to convert the type to a string for this to work.
  • Guest
    Aug 4, 2023
    Additionally, I want to override the label on the axis. For instance, the x-axis might be labeled "utc_endtime", but I want it to say "Month".
  • Guest
    Jun 22, 2020
    That's right, thank you for that suggestion. In my use case that actually works without any issues; I added an $addFields pipeline stage to my data sources to add an additional label field, which I then use in my charts.
  • Guest
    Jun 21, 2020
    Thanks Sander, fair feature request. While we could definitely make this easier, you can accomplish this today with a calculated field using $cond or $switch, for example: { $switch: { branches: [ { case: { $eq: [ '$bedrooms', 1 ] }, then: "small" }, { case: { $eq: [ '$bedrooms', 2 ] }, then: "medium" }, { case: { $eq: [ '$bedrooms', 3 ] }, then: "large" } ], default: "Something else" } }