Thanks for reply. My dead line is very near. I almost there. In my previous program I manually create a template with column names and inserting data into it. its working properly. But my mentor told to get collection schema from data base instead of writing template. Please help me with this.

Ok, I'll give it a shot

So site:https://docs.mongodb.org/ introspection
site:https://docs.mongodb.org/ collection schema
site:https://docs.mongodb.org/ retrieve schema
site:https://docs.mongodb.org/ query schema

So basically, it says while collections have similar schemas, schemas aren't actually enforced, so there is no way to retrieve a "schema" -- it doesn't exist

You can however retrieve every single document ( http://docs.mongodb.org/manual/reference/method/db.collection.find/ )

So does that help or clarify anything?

If I had a deadline I'd ask mentor for help :)


In reply to Re^3: How to get collection schema from mongo using perl by Anonymous Monk
in thread How to get collections from mongo using perl by ravi45722

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.