Mongoose models Part 1

Step 3: Define the Shareholder Schema

Next, we will define the schema for the shareholders.

  1. Create a file named shareholder.js.
  2. Define the basic structure of the Shareholder interface.

Step 4: Using GitHub Copilot for Assistance

GitHub Copilot can help automate some of our tasks. It can suggest types for our schema properties and even create schemas and models.

  1. When you type comments or partial code, GitHub Copilot can suggest completion based on context.
  2. You can even command GitHub Copilot to create something for you if it's relatively obvious.

Final Steps: Export the Models

Once you've defined your schemas, you need to export them so that they can be used in other parts of your application.