New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Should we automatically flatten nested fields in bare rows queries? #4098

Open
camsaul opened this Issue Jan 9, 2017 · 2 comments

Comments

Projects
None yet
3 participants
@camsaul
Member

camsaul commented Jan 9, 2017

The old Query Builder used to let people specify the :fields to be returned in a bare rows query which meant people could pick nested columns to show as top-level columns as they saw fit. Since you can't really do that in the current iteration maybe it makes sense to do it automatically rather than leaving them nested...

Or maybe not. Opened so we can discuss this idea. (Originally discussed in #1328)

@salsakran

This comment has been minimized.

Show comment
Hide comment
@salsakran

salsakran Jan 9, 2017

Contributor

Ideally people could still do this via the "fields list" in table settings, which is meant to take the place of that old field selector.

I think for a lot of mongo collections especially, this would be very useful, as the JSON field view in bare rows queries is pretty useless.

Contributor

salsakran commented Jan 9, 2017

Ideally people could still do this via the "fields list" in table settings, which is meant to take the place of that old field selector.

I think for a lot of mongo collections especially, this would be very useful, as the JSON field view in bare rows queries is pretty useless.

@henry-hz

This comment has been minimized.

Show comment
Hide comment
@henry-hz

henry-hz Feb 23, 2017

we successfully print nested fields using "unwind" , manually:

[
  {"$unwind": "$receivables" },
    
{"$project":{"paymentNumber":"$receivables.paymentNumber" , "uuid":"$receivables.uuid" } },

{"$match":{"_id":{"$eq":"owiejfowiejoweifj"}}} ,

{"$sort": {"_id":1}}

]

henry-hz commented Feb 23, 2017

we successfully print nested fields using "unwind" , manually:

[
  {"$unwind": "$receivables" },
    
{"$project":{"paymentNumber":"$receivables.paymentNumber" , "uuid":"$receivables.uuid" } },

{"$match":{"_id":{"$eq":"owiejfowiejoweifj"}}} ,

{"$sort": {"_id":1}}

]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment