Editing models after creation with command line

We can edit the models right into the common/models/ folder. We have two files for each model created.

The first is a JSON file with all the properties, as we can see in the following code for review.json file:

    { 
      "name": "review", 
      "base": "PersistedModel", 
      "idInjection": true, 
      "options": { 
        "validateUpsert": true 
      }, 
      "properties": { 
        "name": { 
        "type": "string", 
        "required": true 
      }, 
      "email": { 
        "type": "string", 
        "required": true 
      }, 
      "review": { 
          "type": "string", 
          "required": true 
      } 
    }, 
      "validations": [], 
      "relations": {}, 
      "acls": [], 
      "methods": {} 
    } 
 

The second is a JavaScript file, as we can see in the following code for review.js file:

    module.exports = function(Review) { 
    }; 

The JavaScript file is where you ...

Get Node.js 6.x Blueprints now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.