diff --git a/nfirestore-cli/TableFromCollection.cs b/nfirestore-cli/TableFromCollection.cs index 15bdd60..190f0e3 100644 --- a/nfirestore-cli/TableFromCollection.cs +++ b/nfirestore-cli/TableFromCollection.cs @@ -1,4 +1,6 @@ using Google.Cloud.Firestore; +using Newtonsoft.Json; +using System.Collections; using Terminal.Gui; namespace nfirestore_cli @@ -15,7 +17,9 @@ public TableFromCollection(CollectionReference cr, IEnumerable k, d => d.GetSnapshotAsync().Result.ToDictionary()).ToList(); - _columns = _snaps.SelectMany(k=>k.Value.Keys).ToArray(); + var cols = _snaps.SelectMany(k=>k.Value.Keys).Distinct().Order().ToList(); + cols.Insert(0, "Id"); + _columns = cols.ToArray(); } public int Rows => _snaps.Count; @@ -26,11 +30,22 @@ public TableFromCollection(CollectionReference cr, IEnumerable