How to get all the attributes for a particular document and its datatype?

how to get all the attributes for a particular document and its datatype for a collection?

if there is a script it will be helpful.

Hi @Mamatha_M,

Have you tried the Schema Analyser in MongoDB Compass? Sounds like what you are trying to do here.

If you prefer a script, I already used successfully Variety which was enough for what I was doing at the time.

Is it what you are looking for?

Cheers,
Maxime.

Hello @Mamatha_M

you may also can check out the schema in VSCode with the MongoDB plugin. In case this is your favorite editor.

In all other cases compass, as recommended by @MaBeuLux88, will offer you many more features. Personally I use both since, while coding, it is faster to use the features of the editor. The VSCode plugin also brings a sandbox which is great to develop queries.

Cheers
Michael

Here is post with similar question and answers:

2 Likes

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