bookshelf-jsonapi-query
v1.0.0
Published
Fetch bookshelf model using jsonapi query parameter
Downloads
1
Readme
bookshelf-jsonapi-query
A Bookshelf plugin to fetch data using JSON API query format.
Installation
$ npm install --save bookshelf-jsonapi-query
Usage
import plugin from 'bookshelf-jsonapi-query';
// Some Bookshelf instantiation code
const q = {
filter: {
title: 'Post 1',
},
};
Bookshelf.plugin(plugin);
Const Posts = Bookshelf.Model.extend({
...
});
Posts.fetchJsonapi(q);
The fetchJsonapi
takes a query object as its parameter.
The query object are most likely constructed by web frameworks
such as expressjs from a URL query.