We are looking into using Mongo charts in a web based application. Our customer data is segregated on different data bases. Is there a way to embed a dashboard in an application that reads data from the correct DB based on the user.
Hi Mark,
This is not currently supported out of the box, a potential workaround is to duplicate the dashboard and hook it up with different databases/datasources, and in your application, based on the user, you could choose which embed dashboard to render.
If further filter is required within the embed dashboard filter can be applied to each embedded chart: https://www.mongodb.com/docs/charts/filter-embedded-charts/#filter-embedded-charts.
Also if you have any ideas on improvement for the SDK or the Charts app in general, please feel free to submit your idea or feedback through here: Charts: Top (194 ideas) – MongoDB Feedback Engine.
Many thanks,
James
Hi @Mark_Peterson, apologies for the delay in responding. You can dynamically apply a filter on a chart based on the user, but there is no way to dynamically select a collection or database. We are aware of this requirement for users who model data in this way, and are looking into options on how to support this in the future.
Tom
@tomhollander any movement on this requirement? Is it any closer?
Hi @Saul_Gowens, this is something we hope to address next year. Apologies that it’s taken us a while to get to this.
@tomhollander we would be interested in seeing something like this as well.
If the unimplemented proposal is something like just swapping out the cluster and database names by providing authenticated options { ClusterName: ‘foo’, DatabaseName: ‘bar’ } that would be ideal, and the actual Collections would remain the same. At least that’s what I think the OP wants as well.
Thanks Mark, we definitely understand the importance of this scenario for some users. We’ve seen cases where people want to change any combination of cluster, database and collection. None of these are particularly more difficult than any other; the challenge is how to do this securely. We’ve heard that many users partition different customers’ data into different DBs or clusters, so it wouldn’t be acceptable to have the SDK control the data source on the client. If a user from Pepsi logs in they shouldn’t be able to hack the SDK to view data from Coke’s data source. So we need to find a secure way to do this server side, possibly similar to injected filters.
Happy to hear any further ideas or feedback.
Tom