mingo-app / mingo

Found a bug? have a FR ?
60 stars 2 forks source link

Feature: Add select field #481

Closed VladimirMikulic closed 1 year ago

VladimirMikulic commented 2 years ago

Hi!

I was wondering if you could add "select" field between Query and Sort. We have some heavy collections so being able to select only certain fields to return would be a great time saver on query time. Another useful usecase that this would unlock be to Copy JSON/JS (copies exactly what I need without going to exported, loading data etc.)

Screenshot_20220909_202939

Screenshot_20220909_204331

Thanks for amazing tool as always!

tothradoslav commented 2 years ago

Maybe you have noticed that we do have the "project" field in Schema analyzer, for example. With documents, we have considered this many times over and we always bumped into some issues with not showing entire documents (only the selected fields).

First issue would be the same exact advantage you mentioned. We would have to clearly specify whether people are copying the entire doc or just the projected part of it. Editing, adding fields might be another issue. A psychological UX issue might be that people don't realize they are looking at only a part of their documents. And there are several others. One more example: let's say I have 10 columns pinned, but I project only one field. What happens to the 9 other columns pinned? Their "values" would be "undefined" and Mingo has to understand the difference between the field not being projected and / or field having no value. All these are solvable, of course.

I definitely understand your point. We need to think it through properly to prevent confusion. So any ideas / comments on this are very welcome! And thanks again :)

VladimirMikulic commented 2 years ago

Appreciate your reply @tothradoslav. You're definitely right, it is a big feature with many edge cases to account for. It's nothing urgent though, just wanted to put it in your backlog for next major iteration :)

frebos88 commented 1 year ago

As I mentioned in the other issue, we are sometimes using Mingo to write queries before putting them inside an application. Having the option to use projection would be very valuable in those cases. I understand the UX problematics and I agree that with Mingo's design it's really not great to put it inside the normal query view. With that said, I would still love to open up a different view (such as aggregations) with less "smart" functionality that Mingo does great, or have it as a non-default option to toggle.

tothradoslav commented 1 year ago

Considerations / todos:

tothradoslav commented 1 year ago

This has been resolved in the latest RC release, please check it out and let us know if the solution works as expected:

https://github.com/mingo-app/mingo/releases/tag/v1.13.0-rc1

VladimirMikulic commented 1 year ago

@tothradoslav it works great. Thank you so much! I also noticed collections search on the new tab is MUCH faster! Really great work!

tothradoslav commented 1 year ago

https://github.com/mingo-app/mingo/releases/tag/v1.13.1