Permalink
Fetching contributors…
Cannot retrieve contributors at this time
23 lines (16 sloc) 398 Bytes

Create Collection Class

You can create a Collection class from your Database instance. And it requires minimum one property: table:

var Posts = db.createCollection({
  table: 'posts',

  // optional
  modelClass: Post
});

You can also create a Collection class independently:

var Posts = f.createCollection({
  db: db, // instance of your Database

  table: 'posts'
});