Skip to content

Commit

Permalink
Merge pull request #774 from stephenplusplus/spp--docs-streamrouter
Browse files Browse the repository at this point in the history
docs: fix stale autoPaginate documentation
  • Loading branch information
callmehiphop committed Jul 31, 2015
2 parents c324c8e + 5d7ec06 commit b6e6879
Show file tree
Hide file tree
Showing 2 changed files with 37 additions and 38 deletions.
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

0 comments on commit b6e6879

Please sign in to comment.