filter (query, thisArg) {
    return this.query()
      .filter(query, thisArg)
      .run()
  }
Find the record or records that match the provided query or pass the
provided filter function.

Shortcut for `collection.query().filter(queryOrFn[, thisArg]).run()`

@example <caption>Collection#filter</caption>
const JSData = require('js-data');
const { Collection } = JSData;
console.log('Using JSData v' + JSData.version.full);

const collection = new Collection([
  { id: 1, status: 'draft', created_at_timestamp: new Date().getTime() }
]);

// Get the draft posts created less than three months ago
let posts = collection.filter({
  where: {
    status: {
      '==': 'draft'
    },
    created_at_timestamp: {
      '>=': (new Date().getTime() - (1000 \* 60 \* 60 \* 24 \* 30 \* 3)) // 3 months ago
    }
  }
});
console.log(posts);

// Use a custom filter function
posts = collection.filter((post) => post.id % 2 === 0);

@method Collection#filter
@param {(Object|Function)} [queryOrFn={}] Selection query or filter
function.
@param {object} [thisArg] Context to which to bind `queryOrFn` if
`queryOrFn` is a function.
@returns {Array} The result.
@see query
@since 3.0.0