Reputation: 705
I have a Mongo database. I want to create a scripted HTML browser for that data - basically a table of data with a search filter, and sort by column capabilities. I want to build the native Mongo query client side, and just have the server side pretty much straight up execute those (arbitrary) queries. Is that done? Is that bad practice? I will still implement limits and authentication of course.
Upvotes: 0
Views: 70
Reputation: 60875
The problems you could come across when doing this are:
If you can concoct ways to mitigate all these problems, then you can safely do what you want to do. I'm doing something very similar myself except that
A. I'm only allowing arbitrary search queries (no arbitrary updates, those are much more structured)
B. I'm wrapping queries with extra structure so that users can only see data they have access to
C. I'm keeping track of how long a query takes, and killing it if it takes too long (with the potential of doing more sophisticated user resource limiting in the system)
Upvotes: 1