Skip to content

Commit

Permalink
bigquery: table.insert: correct docs (#2153)
Browse files Browse the repository at this point in the history
  • Loading branch information
stephenplusplus authored Mar 29, 2017
1 parent ef5d3bc commit ef0240c
Showing 1 changed file with 16 additions and 4 deletions.
20 changes: 16 additions & 4 deletions src/table.js
Original file line number Diff line number Diff line change
Expand Up @@ -1051,10 +1051,22 @@ Table.prototype.import = function(source, metadata, callback) {
* //-
* // If the callback is omitted, we'll return a Promise.
* //-
* table.insert(rows).then(function(data) {
* var insertErrors = data[0];
* var apiResponse = data[1];
* });
* table.insert(rows)
* .then(function(data) {
* var apiResponse = data[0];
* })
* .catch(function(err) {
* // An API error or partial failure occurred.
*
* if (err.name === 'PartialFailureError') {
* // Some rows failed to insert, while others may have succeeded.
*
* // err.errors (object[]):
* // err.errors[].row (original row object passed to `insert`)
* // err.errors[].errors[].reason
* // err.errors[].errors[].message
* }
* });
*/
Table.prototype.insert = function(rows, options, callback) {
if (is.fn(options)) {
Expand Down

0 comments on commit ef0240c

Please sign in to comment.