Help how to get collection fields?

Hi,

I have a requirement that is similar to this one.

https://www.mongodb.com/community/forums/t/get-all-fields-in-a-collection/315247

I don’t believe the issue was resolved.
I don’t have access to a GUI tool, mainly just to the mongo binary and run commands from there.

I am not able to check the fields in the collection using findOne() as the collection has transient data only where it gets deleted every so often? Is there any other trick maybe to get the fields in some way?

I found this ‘solution’ sort of, but then again, it still depends on having at least one record? :frowning:

var col_list= db.emp.findOne();
for (var col in col_list) { print (col) ; }

Anyone has any other suggestion of sort? Please advise. Thanks.