Query All Your Documents with Javascript

This page shows examples of how to query all the documents in your prismic.io repository.

Without Options

If you need to query all of the documents in your repository, you can just run an empty query.

Copy
//To retreive the API object check how to query the API
api.query('').then(function(content) {
    // content is the response object, content.results holds the documents
});

With Options

You can add options to this query. In the following example we allow 100 documents per page for the query response.

Copy
//To retreive the API object check how to query the API
api.query('', { pageSize : 100 }).then(function(content) {
    // content is the response object, content.results holds the documents
});