Use multiple Predicates

This page shows how to use two or more predicates in a single query.

Example 1

Here's an example that uses two predicates. It shows how to query all of the documents of the custom type "blog_post" with the tag "featured".

Copy
this.$prismic.client.query([
  this.$prismic.Predicates.at('document.type', 'blog_post'),
  this.$prismic.Predicates.at('document.tags', ['featured'])
]).then((response) => {
  // response is the response object, response.results holds the documents
});

Example 2

Here's another example that queries all of the documents of the custom type "employee" excluding those with the tag "manager".

Copy
this.$prismic.client.query([
  this.$prismic.Predicates.at('document.type', 'employee'),
  this.$prismic.Predicates.not('document.tags', ['manager'])
]).then((response) => {
  // response is the response object, response.results holds the documents
});