filter(lookupObj) {
        /**
         * allow foreign keys to be specified as model instances,
         * transform model instances to their primary keys
         */
        const normalizedLookupObj =
            typeof lookupObj === "object"
                ? mapValues(lookupObj, normalizeEntity)
                : lookupObj;

        const filterDescriptor = {
            type: FILTER,
            payload: normalizedLookupObj,
        };
        /**
         * create a new QuerySet
         * including only rows matching the lookupObj
         */
        return this._new(this.clauses.concat(filterDescriptor));
    }
Returns a new {@link QuerySet} instance with entities that match properties in `lookupObj`.

@param  {Object} lookupObj - the properties to match objects with. Can also be a function.
                             It works the same as [Lodash filter](https://lodash.com/docs/#filter).
@return {QuerySet} a new {@link QuerySet} instance with objects that passed the filter.