Skip to Main Content

MongoByte MongoDB Logo

Welcome to the new MongoDB Feedback Portal!

{Improvement: "Your idea"}
We’ve upgraded our system to better capture and act on your feedback.
Your feedback is meaningful and helps us build better products.

Status Submitted
Categories IDEs
Created by Guest
Created on Jan 24, 2025

Script a schema

In schema explorer, right click a collection Schema, and have the option to "Generate Script". This would generate a js file such as: var Comments = new Schema({ title : String , body : String , date : Date }); Alternatively or additionally, you could click the collection, and "Generate Script" and it would generate a script for creating the schema AND indexes. It would also be helpful to be able to perform this at the database level, which would generate the script for every collection in the database.