Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 18 additions & 16 deletions lib/bigquery/job.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,34 +115,36 @@ Job.prototype.getMetadata = function(callback) {
* @param {object} callback.apiResponse - The full API response.
*
* @example
* var callback = function(err, rows, nextQuery, apiResponse) {
* if (nextQuery) {
* // More results exist.
* job.getQueryResults(nextQuery, callback);
* }
* };
*
* //-
* // Use the default options to get the results of a query.
* // Get all of the results of a query.
* //-
* job.getQueryResults(callback);
* job.getQueryResults(function(err, rows) {
* if (!err) {
* // rows is an array of results.
* }
* });
*
* //-
* // Customize the results you want to fetch.
* //-
* job.getQueryResults({
* maxResults: 100
* }, callback);
* }, function(err, rows) {});
*
* //-
* // To have pagination handled for you, set `autoPaginate`. Note the changed
* // callback parameters.
* // To control how many API requests are made and page through the results
* // manually, set `autoPaginate` to `false`.
* //-
* var callback = function(err, rows, nextQuery, apiResponse) {
* if (nextQuery) {
* // More results exist.
* job.getQueryResults(nextQuery, callback);
* }
* };
*
* job.getQueryResults({
* autoPaginate: true
* }, function(err, rows) {
* // Called after all rows have been retrieved.
* });
* autoPaginate: false
* }, callback);
*
* //-
* // Consume the results from the query as a readable object stream.
Expand Down
41 changes: 19 additions & 22 deletions lib/pubsub/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -119,26 +119,33 @@ function PubSub(options) {
* service.
*
* @example
* // Get all topics.
* pubsub.getTopics(function(err, topics, nextQuery, apiResponse) {
* // If `nextQuery` is non-null, there may be more results to fetch. To do
* // so, run `pubsub.getTopics(nextQuery, callback);`.
* pubsub.getTopics(function(err, topics) {
* if (!err) {
* // topics is an array of Topic objects.
* }
* });
*
* //-
* // Customize the query.
* //-
* pubsub.getTopics({
* pageSize: 3
* }, function(err, topics, nextQuery, apiResponse) {});
* }, function(err, topics) {});
*
* //-
* // To have pagination handled for you, set `autoPaginate`. Note the changed
* // callback parameters.
* // To control how many API requests are made and page through the results
* // manually, set `autoPaginate` to `false`.
* //-
* var callback = function(err, rows, nextQuery, apiResponse) {
* if (nextQuery) {
* // More results exist.
* pubsub.getTopics(nextQuery, callback);
* }
* };
*
* pubsub.getTopics({
* autoPaginate: true
* }, function(err, topics) {
* // Called after all topics have been retrieved.
* });
* autoPaginate: false
* }, callback);
*
* //-
* // Get the topics as a readable object stream.
Expand Down Expand Up @@ -421,20 +428,10 @@ PubSub.prototype.topic = function(name) {
* };
*
* pubsub.getSubscriptions({
* autoPaginate: false,
* autoPaginate: false
* }, callback);
*
* //-
* // To have pagination handled for you, set `autoPaginate`. Note the changed
* // callback parameters.
* //-
* pubsub.getSubscriptions({
* autoPaginate: true
* }, function(err, subscriptions) {
* // Called after all subscriptions have been retrieved.
* });
*
* //-
* // Get the subscriptions as a readable object stream.
* //-
* pubsub.getSubscriptions()
Expand Down