Send Docs Feedback

Data queries

API BaaS supports a powerful, SQL-like query language that allows you to apply retrieve, update and delete operations to a narrowed set of entities in your data store.

Request construction

Queries are sent to the Apigee API as part of the request URL, and are made up of two parts:

  • The path to the collection you want to query
  • The query language statement containing your query

These two statements are separated by ?ql= to indicate where the query language statement starts.

For example, a GET request to the following URL would return all the entities in the users that contain the property status:'active':'active'

SQL-like syntax

The Apigee API supports a SQL-like query syntax that will be familiar to most users that have experience working with relational databases, including operators such as and, or, and not. As with SQL queries, these operators can be used to form complex queries that return a more refined result set.

For example, the following would query the Apigee API for the first 5 user entities that contain the properties status:'active' and age less than 40, in ascending order by their name property:'active' and age lt 40 order by name asc

For a complete list of supported operators and data types, see Supported query operators & data types. For more on advanced query usage see Query parameters & clauses.

Writing efficient queries

As a best practice, you should include no more than 3 parameters in your queries. The API will not prevent you from submitting a query with more than 3 parameters; however, due to the nature of NoSQL, queries with many parameters can quickly become very inefficient.

On the backend API BaaS stores your data in a NoSQL (Cassandra) database. This makes your data store extremely flexible, but also requires a different approach to storing and retrieving data than users of a traditional RDBMS, such as MySQL, will be accustomed to.

For more information, see our API BaaS DBMS overview and Data store best practices.

Using queries

For more detail about support for queries, see the following topics:

Help or comments?