Quantcast
Channel: mongoose schema creation - Stack Overflow
Viewing all articles
Browse latest Browse all 3

mongoose schema creation

$
0
0

I've just started with mongoose. I have a creation script with mongoose that creates the schemas and db with sample data.

Now I write the actual application. Do I need to create the schema object each time my application runs, or is it already available somehow?

In other words do I need to run this code in every app that uses mongoose to access the db or just the first time:

var Comments = new Schema({    title     : String  , body      : String  , date      : Date});

How would the answer change if I have setters/validations/etc?


Viewing all articles
Browse latest Browse all 3

Trending Articles





<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>