Can I Rearrange Fields in Query's Table View

Hello, I recently migrated to Couchbase from MongoDB. I like them both but prefer Couchbase.

I have a question about viewing documents in Table View in the Query editor.

Is there a way to adjust the order of the fields in Query/Table View? I have a movie collection database, and the documents’ fields are not in the order I prefer.

Below is a screenshot of a query in Table mode. I’d like the fields to be in the following order:

docid, title, director, foreign, silent, country. (I’ll be removing the id field because it is redundant with docid).

I’ll be adding data to these documents. I plan on using YAML code to create arrays for such fields as genre and actors. I understand pyYAML can convert the YAML to JSON and then embed the arrays into already-existing documents. I will want those fields at the end of the table. But right now, I want the fields in the order I just stated.

Is this possible? Is there a way for me to adjust the order of the fields? If so, what is needed to do this? I’m using the Community edition locally on my computer, if that makes a difference.

Thank you! Jd

I don’t think so.
json does not have an ‘order’ for properties. Although the Query Workbench seems to display them in alphabetical order. So you could give them names to influence the order…

select docid a_docid, title b_title, director c_director, foreign d_foreign, silent e_silent, country, f_country

{ director, foreign and silent don’t really need labels as they are luckily already in order)

The Query Workshop is just for quick testing of n1ql, it’s not intend for generating reports.

Yes, they are in alphabetical order. Renaming the fields should work. Thank you.

FYI: It all depends on client how those process and display. Query Work Bench formats those and orders.

Only top level fields. if there is star with in star sorted alphabetically (CURL or cbq shell you will see)

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.