Creates a query to retrieve a list of posts.
The queryPosts()
function builds a query to retrieve a list of up to 100 posts, and returns a PostsQueryBuilder
object.
The returned object contains the query definition which is typically used to run the query using the find()
function.
You can refine the query by chaining PostsQueryBuilder
functions onto the query. PostsQueryBuilder
functions enable you to sort, filter, and control the results that queryPosts()
returns.
queryPosts()
runs with these PostsQueryBuilder
defaults that can be overridden:
Note that the default limit is '50'
, but the max limit is '100'
.
To learn how to query posts, refer to the table below.
The following PostsQueryBuilder
functions are supported for the queryPosts()
function. For a full description of the Posts object, see the object returned for the items
property in PostsQueryResult
.
Options specifying which fields to return.