Creates a query to retrieve a list of up to 100 draft posts.
The queryDraftPosts() function builds a query to retrieve a list of up to 100 draft posts, and returns a DraftPostsQueryBuilder 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 DraftPostsQueryBuilder functions onto the query. DraftPostsQueryBuilder functions enable you to sort, filter, and control the results that queryDraftPosts() returns.
queryDraftPosts() runs with these DraftPostsQueryBuilder defaults that can be overridden:
limit(50)ascending('_id')The following DraftPostsQueryBuilder functions are supported for queryDraftPosts(). For a full description of the Draft Posts object, see the object returned for the items property in DraftPostsQueryResult.
| PROPERTY | SUPPORTED FILTERS & SORTING |
|---|---|
_id | eq(),ne(),in(),ascending(),descending() |
title | eq(),ne(),startsWith(),lt(),le(),gt(),ge(),exists(),in(),ascending(),descending() |
excerpt | eq(),ne(),startsWith(),lt(),le(),gt(),ge(),exists(),in(),ascending(),descending() |
featured | eq(),ne(),ascending(),descending() |
categoryIds | hasSome(),hasAll() |
hashtags | hasSome(),hasAll() |
commentingEnabled | eq(),ne(),ascending(),descending() |
minutesToRead | eq(),ne(),lt(),le(),gt(),ge(),in() |
tagIds | hasSome(),hasAll() |
pricingPlanIds | hasSome(),hasAll() |
translationId | eq(),ne(),exists(),in() |
language | eq(),ne(),exists(),in() |
status | eq(),ne(),in(),ascending(),descending() |
hasUnpublishedChanges | eq(),ne(),ascending(),descending() |
editedDate | eq(),ne(),lt(),le(),gt(),ge(),in(),ascending(),descending() |
scheduledPublishDate | eq(),ne(),lt(),le(),gt(),ge(),in(),ascending(),descending() |
Options for querying draft posts.
This method doesn't return any custom errors, but may return standard errors. Learn more about standard Wix errors.