M001: View schema details in mongo shell

Hi,
How can view the schema details (i.e., fields / data type) of a document using Mongo Shell?

Thanks and Regards,
Yeshwant Gupta.

Hi @Yeshwant_Kumar_08131,

If you want to view schema of only one document, then there are javascript functions which you can use. Here is the link:

But if you want to analyze the schema for a whole collection, Compass is the best way to do it. :slight_smile: Download Stable version and there is a Schema tab.

Kanika