How to use odata-query - 2 common examples

To help you get started, we’ve selected a few odata-query examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github techniq / react-odata / src / OData.js View on Github external
function buildUrl(baseUrl, query) {
  return query !== false && baseUrl + buildQuery(query);
}
github relair / odata-data-source / projects / odata-data-source / src / lib / odata-data-source.ts View on Github external
query.orderBy = [`${sortBy} desc`];
      }
    } else if (this.initialSort && this.initialSort.length) {
      query.orderBy = this.initialSort;
    }

    if (filters) {
      const filterQuery = { and: [] };
      filters.forEach(filter => {
        filterQuery.and.push(filter.getFilter());
      });

      query.filter = filterQuery;
    }

    url = url + buildQuery(query);
      
    return this.httpClient.get(url) as Observable<object>;
  }

odata-query

OData v4 query builder that uses a simple object-based syntax similar to [MongoDB](https://docs.mongodb.com/manual/reference/operator/query/) and [js-data](http://www.js-data.io/v3.0/docs/query-syntax)

MIT
Latest version published 4 months ago

Package Health Score

72 / 100
Full package analysis

Popular odata-query functions