beforeQuery() hook runs when:
find function is called.
- An action is performed on a dataset that retrieves items from the collection.
- The collection is viewed in the Content Manager.
- An item is imported into the collection. (Sandbox only.)
- An item is exported from the collection. (Sandbox only.)
The hook also runs when an action is performed on a dataset that retrieves
items from the collection that the dataset is connected to.
beforeQuery() hook is called before
is executed, it can affect the query that is used to retrieve items
or block the
Return a query or a Promise that resolves to a query from the
function to perform the find. The returned query will be used as the query for the
Often, you will modify the query that is received in the
by calling one or more
Return a rejected Promise to block the call to
onFailure() hook runs if it has been registered.
If the returned value is of the wrong type, the value is ignored.