This is a simple example of how to use many to many relationships with Bookshelf.js. This example was put together using Perk - a well documented set of tools for building node web applications.
This example was created for the Perk Documentation on many to many relationships
- Git clone this repo
- cd into project and
npm install - Install knex:
npm install -g knex - With PostgreSQL:
createdb many-to-many - Boot up the server
npm run dev - Run migrations:
knex migrate:latest - Run seed files:
knex seed:run - Fill in database credentials and random string for session secret.
- Go to http://localhost:3000
Look at these files for the necessary pieces to establish a many to many relationship using Bookshelf.js.