Use Multiple Predicates

You can combine multiple predicates in a single query, for example querying for a certain custom type with a given tag.

Here's an example that queries all of the documents of the custom type “blog-post” with the tag “featured”

Copy
      api.query([
    Prismic.Predicates.at('document.type', 'blog-post'),
    Prismic.Predicates.at('document.tags', ['featured'])
]).then(function(content) {
    // content is the response object, content.results holds the documents
});
    
Copy
      $content = $api->query(
    [ Predicates::at('document.type', 'blog-post'),
      Predicates::at('document.tags', ['featured']) ]
);
// $content contains the response object, $content->getResults() holds the documents
    
Copy
      content = api.query([
    Prismic::Predicates.at("document.type", "blog-post"),
    Prismic::Predicates.at("document.tags", ["featured"])
])
# content contains the response object, content.results holds the documents
    

Here's an example that queries all of the documents of the custom type “employee” excluding those with the tag “manager”

Copy
      api.query([
    Prismic.Predicates.at('document.type', 'employee'),
    Prismic.Predicates.not('document.tags', ['manager'])
]).then(function(employees) {
    // employees is the response object, employees.results holds the documents
});
    
Copy
      $employees = $api->query(
    [ Predicates::at('document.type', 'employee'),
      Predicates::not('document.tags', ['manager']) ]
);
// $employees contains the response object, $employees->getResults() holds the documents
    
Copy
      employees = api.query([
    Prismic::Predicates.at("document.type", "employee"),
    Prismic::Predicates.not("document.tags", ["manager"])
])
# employees contains the response object, employees.results holds the documents