Query Options
Last updated
const api = Comfortable.api('<repository-api-id>', '<api-key>');
api.getDocuments({
offset: 0
})
.then(result => {
// futher implementation
})
.catch(err => {
throw err;
})const api = Comfortable.api('<repository-api-id>', '<api-key>');
api.getDocuments({
locale: 'en'
})
.then(result => {
// futher implementation
})
.catch(err => {
throw err;
})var options = {
includes: new Comfortable.Include()
.add('relatedNews')
}const api = Comfortable.api('<repository-api-id>', '<api-key>');
api.getDocuments({
includes: 2 // aggregation level
})
.then(result => {
// futher implementation
})
.catch(err => {
throw err;
})const api = Comfortable.api('<repository-api-id>', '<api-key>');
api.getDocuments({
includeTags: ['include', 'me']
})
.then(result => {
// futher implementation
})
.catch(err => {
throw err;
})const api = Comfortable.api('<repository-api-id>', '<api-key>');
api.getDocuments({
excludeTags: ['exclude', 'this']
})
.then(result => {
// futher implementation
})
.catch(err => {
throw err;
})var options = {
fields: 'meta,fields(title,date)'
}const api = Comfortable.api('<repository-api-id>', '<api-key>');
api.getDocuments({
fields: 'meta,fields(title)'
})
.then(result => {
// futher implementation
})
.catch(err => {
throw err;
})const api = Comfortable.api('<repository-api-id>', '<api-key>');
api.getDocuments({
embedAssets: true
})
.then(result => {
// futher implementation
})
.catch(err => {
throw err;
})const api = Comfortable.api('<repository-api-id>', '<api-key>');
api.getDocuments({
filters: new Comfortable.Filter()
.addAnd('title', 'like', '%Hello%')
.addAnd('date', 'greaterThan', '2018-07-04')
.addOr('topNews', 'equal', true)
})
.then(result => {
// futher implementation
})
.catch(err => {
throw err;
})const api = Comfortable.api('<repository-api-id>', '<api-key>');
api.getDocuments({
sorting: new Comfortable.Sorting()
.add('date', 'asc')
.add('title', 'asc')
})
.then(result => {
// futher implementation
})
.catch(err => {
throw err;
})const api = Comfortable.api('<repository-api-id>', '<api-key>');
api.getDocuments({
search: 'sport -football +soccer'
})
.then(result => {
// futher implementation
})
.catch(err => {
throw err;
})