Support for Mongoose models in Bloggify.
# Using npm
npm install --save bloggify-mongoose
# Using yarn
yarn add bloggify-mongoose
// Configuration example
module.exports = {
db: "mongodb://localhost/people"
, models_dir: "path/to/models"
/*
Comment.js:
module.exports = {
body: String,
...
};
*/
, models: {
User: {
name: {
first: {
type: String
, required: true
, match: [/.*\S+.*/, "Invalid name."]
}
, last: {
type: String
, required: true
, match: [/.*\S+.*/, "Invalid name."]
}
}
, email: {
type: String
, index: true
, required: true
, match: [/^\w+([\.-]?\w+)*@\w+([\.-]?\w+)*(\.\w{2,3})+$/, "Please fill a valid email address."]
}
}
}
};
There are few ways to get help:
- Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
- For bug reports and feature requests, open issues. 🐛
- Object
config
: uri
(String): The database url.models
(Object): An object containing the Mongoose models.models_dir
(String): The relative path to a directory containing models stored in files.
The model objects can be accessed by requiring the module or accessing the Bloggify.models
object.
Have an idea? Found a bug? See how to contribute.
If you are using this library in one of your projects, add it in this list. ✨
todos-app-bloggify-react