💽 Support for Mongoose models in Bloggify.
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
example
lib
.gitignore
CONTRIBUTING.md
DOCUMENTATION.md
LICENSE
README.md
package-lock.json
package.json

README.md

bloggify-mongoose

Version Downloads

Support for Mongoose models in Bloggify.

☁️ Installation

$ npm i --save bloggify-mongoose

📋 Example

// 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."]
            }
        }
    }
};

Get Help

There are few ways to get help:

  1. Please post questions on Stack Overflow. You can open issues with questions, as long you add a link to your Stack Overflow question.
  2. For bug reports and feature requests, open issues. 🐛
  3. For direct and quick help, you can use Codementor. 🚀

📝 Documentation

Plugin Configuration

  • 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.

😋 How to contribute

Have an idea? Found a bug? See how to contribute.

💫 Where is this library used?

If you are using this library in one of your projects, add it in this list.

  • bloggify (by Bloggify)—We make publishing easy.
  • bloggify.org (by Bloggify)—The Bloggify.org website source code.

📜 License

MIT © Bloggify