Views

Views

Source:

Methods for views.

Methods

(static) createRecord(viewName, recordValuesObj, optionsopt) → {Promise.<({status: 201, statusText: 'Created', message: string}|{status: 201, statusText: 'Created', message: string, createdRecord: object})>}

Source:
Since:
  • 1.0.0

Creates a record in view viewName (generally not a recommended method to use due to the notes that follow). Directly creating a record in a table should always be the preferred route since creating a record in a view ultimately results in creating a single record in an underlying table.

Note 1 (required conditions for creating a record in a view): Records may only be created in a view if the view itself only contains a single table or if a particular table in the view has been specified as editable within the view's configuration. This can be done by selecting a table under the "Do you need to edit data using this View?" question when editing a view within Caspio.

Note 2 (creating a record in a view where the record does not appear in the view): It is possible for a record to be "created" in the view but not appear as the value for the createdRecord property of the response object. How? If the record is no longer included in the view after its creation, then the record does not appear as having been created in the view. How could this happen? If a field value is being used to make the record appear in the view, such as the Account_Status field needing to be true in a Demo_Physicians_Active view, then creating a record where the Account_Status field value was false would result in the record being excluded from the view but created in the underlying Demo_Physicians table; hence, the record would correspondingly be excluded from the createdRecord property of the response object.

Example
// create one record that remains in the view after creation (i.e., email of "oscarmartinez@google.com")
// create another record that ends up being filtered out of the view (i.e., email of "jimhalpert@google.com")
const caspio = require('caspio-sdk')(caspioCredentials);

async function createViewRecord() {
  const newRecordObjGood = {
    First_Name: "Oscar",
    Last_Name: "Martinez",
    Email: "oscarmartinez@google.com",
    Account_Status: true
  }
  const newRecordObjBad = {
    First_Name: "Jim",
    Last_Name: "Halpert",
    Email: "jimhalpert@google.com",
    Account_Status: false
  }
  const VIEW_NAME = 'Demo_Physicians_Active';
  const createResultOne = await caspio.views.createRecord(VIEW_NAME, newRecordObjGood, { row: true });
  const createResultTwo = await caspio.views.createRecord(VIEW_NAME, newRecordObjBad, { row: true });
  console.log(createResultOne);
  console.log(createResultTwo);
  return [ createResultOne, createResultTwo ]
}

createViewRecord();

// example return value(s)
[
  {
    status: 201,
    statusText: 'Created',
    message: 'Record successfully created.',
    createdRecord: {
      Physician_ID: 'PVFHYYQH',
      Date_Created: null,
      First_Name: 'Oscar',
      Last_Name: 'Martinez',
      Full_Name: 'Oscar Martinez',
      Gender: '',
      Email: 'oscarmartinez@google.com',
      Account_Status: true,
      Profile_Status: false,
      Profile_Picture: null,
      Specialties: null,
      About_Section: '',
      Education_and_Training: '',
      Languages_Spoken: null,
      Office_Address: '',
      Office_City: '',
      Office_State: '',
      Office_Zip: '',
      Title: '',
      Accepting_New_Patients: false,
      Affiliations: '',
      Board_Certifications: '',
      Office_Name: '',
      Office_Phone: '',
      ViewCount: null
    }
  },
  {
    status: 201,
    statusText: 'Created',
    message: 'Record successfully created.',
    createdRecord: undefined
  }
]
Parameters:
Name Type Attributes Default Description
viewName string

Name of view (case-insensitive)

recordValuesObj object

Object with key-value pairs in the form <fieldName>:<updatedFieldValue>; that is, any provided key should match a field's Name to be created and the key's value should be the value for that field (e.g., { "First_Name": "Updated First Name", "Last_Name": "Updated Last Name" }).

options object <optional>
{ 'row': false }

The options object currently only supports the row option. If no object is provided, then { 'row': false } is taken as the default value. If an options object is provided with a row property value of true, then the record created by the query is returned in the response object as the value for the createdRecord property--if no record shows up as having been created, then undefined becomes the value for the createdRecord key.

Properties
Name Type Attributes Default Description
row boolean <optional>
false
Returns:

Object with information about the attempted creation of the provided record (i.e., status, statusText, message, and createdRecord if the options argument was passed as { 'row': true }). If { 'row': true } is not specified as the third argument, then the response object will not have a createRecord property; if, however, { 'row': true } is specified but the record was created in an underlying table but does not appear in the view itself, then undefined will be the value for the createdRecord property of the response object.

Type
Promise.<({status: 201, statusText: 'Created', message: string}|{status: 201, statusText: 'Created', message: string, createdRecord: object})>

(static) deleteRecords(viewName, whereClause) → {Promise.<{status: 200, statusText: 'OK', message: string, recordsAffected: number}>}

Source:
Since:
  • 1.0.0

Deletes all records from viewName matched by whereClause (i.e., the provided WHERE clause). This method is generally not recommended due to the notes that follow. Directly deleting records in a table should always be the preferred route since deleting records in a view ultimately results in deleting records from a single underlying table.

Note (required conditions for deleting a record from a view): Records may only be deleted in a view if the view itself only contains a single table or if a particular table in the view has been specified as editable within the view's configuration. This can be done by selecting a table under the "Do you need to edit data using this View?" question when editing a view within Caspio.

Example
// Delete all records from the 'Demo_Physicians_Active' view
// that have an 'Email' field value of 'oscarmartinez@google.com'
const caspio = require('caspio-sdk')(caspioCredentials);

async function deleteRecordsFromView() {
  const whereClause = `Email = 'oscarmartinez@google.com'`;
  const VIEW_NAME = 'Demo_Physicians_Active';
  const deleteResult = await caspio.views.deleteRecords(VIEW_NAME, whereClause);
  console.log(deleteResult);
  return deleteResult;
}

deleteRecordsFromView();

// sample return value
{
  status: 200,
  statusText: 'OK',
  message: '1 record(s) successfully deleted.',
  recordsAffected: 1
}
Parameters:
Name Type Description
viewName string

Name of view (case-insensitive)

whereClause string

WHERE clause (i.e., query to match records to be affected)

Returns:

Object with information about the attempted deletion of the records matched by the WHERE clause (i.e., status, statusText, message, and recordsAffected)

Type
Promise.<{status: 200, statusText: 'OK', message: string, recordsAffected: number}>

(static) description(viewName) → {Promise.<{Name: string, Note: string}>}

Source:
Since:
  • 1.0.0

Returns the description of the view (i.e., a description of view viewName).

Example
// get description of the 'Demo_Physicians_Active' view
const caspio = require('caspio-sdk')(caspioCredentials);

async function getViewDescription() {
  const VIEW_NAME = 'Demo_Physicians_Active';
  const description = await caspio.views.description(VIEW_NAME);
  console.log(description);
  return description;
}

getViewDescription();

// sample return value
{ Name: 'Demo_Physicians_Active', Note: '' }
Parameters:
Name Type Description
viewName string

Name of the view (case-insensitive)

Returns:

Object with the name of view (i.e., Name) and a note about the view (i.e., Note)

Type
Promise.<{Name: string, Note: string}>

(static) getRecords(viewName, selectionCriteriaObjopt) → {Promise.<Array.<Object>>}

Source:
Since:
  • 1.0.0

Returns all records from the view that satisfy the provided query criteria (i.e., selectionCriteriaObj). Pagination is automatically handled to ensure all records matching the provided criteria are returned.

Note (potential strain on memory resources): If the query provided results in many thousands or millions of records needing to be returned, then this may cause a strain on memory resources (since all returned records are held in memory when using this method). Consider using the getRecordsStreamToFile method in such an instance where all returned records can be streamed to a file in batches of 1000 records (i.e., the maximum number of records Caspio's REST API will respond with for any request).

Example
// get all records from the 'Demo_Physicians_Active' view
const caspio = require('caspio-sdk')(caspioCredentials);

async function getViewRecords() {
  const VIEW_NAME = 'Demo_Physicians_Active';
  const viewRecords = await caspio.views.getRecords(VIEW_NAME);
  console.log(viewRecords);
  return viewRecords;
}

getViewRecords();

// sample return value
[
  ...,
  {
    Physician_ID: '6T2C9HW8',
    Date_Created: '2020-10-07T04:54:19',
    First_Name: 'Lelah',
    Last_Name: 'Hoppe',
    Full_Name: 'Lelah Hoppe',
    Gender: 'Other',
    Email: 'Lelah.Hoppe@gmail.com',
    Account_Status: true,
    Profile_Status: false,
    Profile_Picture: '/Demo/LelahHoppe.png',
    Specialties: {
      '3': 'Family Medicine',
      '6': 'Obstetrics and Gynecology',
      '8': 'Pain Management',
      '9': 'Pathology'
    },
    About_Section: 'Exercitationem ... labore.',
    Education_and_Training: 'David Geffen School of Medicine - MD\n' +
      'Yale - Residency, Ophthalmology\n' +
      'Yale - Fellowship, Cataracts and Refractive Surgery',
    Languages_Spoken: { '2': 'English', '4': 'French', '7': 'Japanese', '9': 'Spanish' },
    Office_Address: '0519 Mustafa Via',
    Office_City: 'New Bradlyhaven',
    Office_State: 'MI',
    Office_Zip: '50198',
    Title: 'Adolescent Medicine Specialist',
    Accepting_New_Patients: true,
    Affiliations: 'American College of Endocrinology\n' +
      'The Endocrine Society\n' +
      'American Diabetes Association',
    Board_Certifications: 'American Board of Pediatrics',
    Office_Name: 'Davis Family Medical Group',
    Office_Phone: '967-841-6054',
    ViewCount: 3654
  },
  ...
]
Parameters:
Name Type Attributes Default Description
viewName string

Name of view (case-insensitive)

selectionCriteriaObj Object <optional>
{}

Object that specifies the criteria to be used in constructing the query. Valid properties include the following: select, where, groupBy, and orderBy.

In large part, the query being constructed resembles most queries constructed using SQL (specifically the SQL Server dialect since Caspio uses SQL Server under the hood). Consult a Caspio rep to find which version your account is running on.

Note: Usage of window functions when expecting more than 1000 records is problematic due to being rate-limited at 1000 records per request (hence there's not an effective window within which to operate).

Properties
Name Type Attributes Default Description
select string <optional>
'*'

List of fields separated by comma, where fields may either be fields directly from the specified view or could be a combination of numerous other things:

aliases such as First_Name AS name;

subqueries that return one value such as (SELECT COUNT(User_ID) FROM Demo_Users) AS demo_users_count;

correlated subqueries such as (SELECT Email FROM Users WHERE Participant_ID = _v_Highlighted_Users.Participant_ID), Notable_Highlight when Highlighted_Users is the value of the viewName argument (i.e., the singular view from which records are being pulled);

window functions such as ROW_NUMBER() OVER(PARTITION BY Company, Department ORDER BY Salary DESC, Experience DESC, User_ID) AS comp_dept_sal_rnk to compute salary rankings within departments of a company first by salary amount, years of experience, and finally the User_ID if needed to break ties.

The possibilities are endless--there are numerous possibilities with which to experiment.

Note: If you want to use a view in a correlated subquery as shown above, then be sure to add a prefix of _v_ to the view name, as specified in Caspio's documentation on calculations in reports.

where string <optional>
''

WHERE clause. This is used to find the desired records. You may use subqueries in this clause (e.g., User_ID IN (SELECT ... FROM ... ) among other examples)) as well as AND, OR, etc. Much power can be leveraged by using this clause effectively.

groupBy string <optional>
''

GROUP BY clause. Useful for grouping records by specified fields to consequently make aggregate calculations.

orderBy string <optional>
''

ORDER BY clause. Useful for having SQL Server do the heavy lifting concerning sorting before the response gets transmitted across the wire.

Returns:

An array of objects representing the records retrieved from the specified view (i.e., viewName) that were obtained by the query provided (i.e., selectionCriteriaObj).

Type
Promise.<Array.<Object>>

(static) getRecordsPaginated(viewName, selectionCriteriaObjopt) → {Promise.<Array.<Object>>}

Source:
Since:
  • 1.0.0

Returns records in a paginated fashion from view viewName that satisfy the provided query criteria (i.e., selectionCriteriaObj).

Example
// get a single record from the 'Demo_Physicians_Active' view
const caspio = require('caspio-sdk')(caspioCredentials);

async function getPaginatedViewRecords() {
  const criteriaObj = {
    limit: 1
  }
  const VIEW_NAME = 'Demo_Physicians_Active';
  const viewRecords = await caspio.views.getRecordsPaginated(VIEW_NAME, criteriaObj);
  console.log(viewRecords);
  return viewRecords;
}

getPaginatedViewRecords();

// sample return value
[
  {
    Physician_ID: '6T2C9HW8',
    Date_Created: '2020-10-07T04:54:19',
    First_Name: 'Lelah',
    Last_Name: 'Hoppe',
    Full_Name: 'Lelah Hoppe',
    Gender: 'Other',
    Email: 'Lelah.Hoppe@gmail.com',
    Account_Status: true,
    Profile_Status: false,
    Profile_Picture: '/Demo/LelahHoppe.png',
    Specialties: {
      '3': 'Family Medicine',
      '6': 'Obstetrics and Gynecology',
      '8': 'Pain Management',
      '9': 'Pathology'
    },
    About_Section: 'Exercitationem ... labore.',
    Education_and_Training: 'David Geffen School of Medicine - MD\n' +
      'Yale - Residency, Ophthalmology\n' +
      'Yale - Fellowship, Cataracts and Refractive Surgery',
    Languages_Spoken: { '2': 'English', '4': 'French', '7': 'Japanese', '9': 'Spanish' },
    Office_Address: '0519 Mustafa Via',
    Office_City: 'New Bradlyhaven',
    Office_State: 'MI',
    Office_Zip: '50198',
    Title: 'Adolescent Medicine Specialist',
    Accepting_New_Patients: true,
    Affiliations: 'American College of Endocrinology\n' +
      'The Endocrine Society\n' +
      'American Diabetes Association',
    Board_Certifications: 'American Board of Pediatrics',
    Office_Name: 'Davis Family Medical Group',
    Office_Phone: '967-841-6054',
    ViewCount: 3654
  }
]
Parameters:
Name Type Attributes Default Description
viewName string

Name of view (case-insensitive)

selectionCriteriaObj Object <optional>
{}

Object that specifies the criteria to be used in constructing the query. Valid properties include the following: select, where, groupBy, orderBy, limit, pageNumber, and pageSize.

In large part, the query being constructed resembles most queries constructed using SQL (specifically the SQL Server dialect since Caspio uses SQL Server under the hood). Consult a Caspio rep to find which version your account is running on.

Note: Usage of window functions (e.g., ROW_NUMBER()) when expecting more than 1000 records is problematic due to being rate-limited by Caspio's servers at 1000 records per request (hence there's not an effective window within which to operate).

Properties
Name Type Attributes Default Description
select string <optional>
'*'

List of fields separated by comma, where fields may either be fields directly from the specified view or could be a combination of numerous other things:

aliases such as First_Name AS name;

subqueries that return one value such as (SELECT COUNT(User_ID) FROM Demo_Users) AS demo_users_count;

correlated subqueries such as (SELECT Email FROM Users WHERE Participant_ID = _v_Highlighted_Users.Participant_ID), Notable_Highlight when Highlighted_Users is the value of the viewName argument (i.e., the singular view from which records are being pulled);

window functions such as ROW_NUMBER() OVER(PARTITION BY Company, Department ORDER BY Salary DESC, Experience DESC, User_ID) AS comp_dept_sal_rnk to compute salary rankings within departments of a company first by salary amount, years of experience, and finally the User_ID if needed to break ties.

The possibilities are endless--there are numerous possibilities with which to experiment.

Note: If you want to use a view in a correlated subquery as shown above, then be sure to add a prefix of _v_ to the view name, as specified in Caspio's documentation on calculations in reports.

where string <optional>
''

WHERE clause. This is used to find the desired records. You may use subqueries in this clause (e.g., User_ID IN (SELECT ... FROM ... ) among other examples) as well as AND, OR, etc. Much power can be leveraged by using this clause effectively.

groupBy string <optional>
''

GROUP BY clause. Useful for grouping records by specified fields to consequently make aggregate calculations.

orderBy string <optional>
''

ORDER BY clause. Useful for having SQL Server do the heavy lifting concerning sorting before the response gets transmitted across the wire.

limit number <optional>
100

Specifies the maximum number of records to be returned. Maximum possible value of 1000 with a default value of 100. Skipped if either pageNumber or pageSize has been specified.

pageNumber number <optional>

Page number corresponding to the pagination that results from the initial query. Defaults to 1 if pageSize has been specified but pageNumber has not.

pageSize number <optional>

Number of records per page (possible from 5 to 1000). Defaults to 25 if pageNumber has been specified but pageSize has not.

Returns:

An array of objects representing the records retrieved from the specified view (i.e., viewName) that were obtained by the query provided (i.e., selectionCriteriaObj).

Type
Promise.<Array.<Object>>

(static) getRecordsStreamToFile(viewName, filePath, selectionCriteriaObjopt) → {void}

Source:
Since:
  • 1.0.0

Streams all records from the view (i.e., viewName) that satisfy the provided query criteria (i.e., selectionCriteriaObj) to a file (i.e., filePath). Pagination is automatically handled to ensure all records matching the provided criteria are streamed to the specified file. Records are streamed in batches of 1000 records (Caspio's rate limit for returning records). Useful when you need to process huge amounts of data but do not want to hold everything in memory.

Example
// stream all records from the 'Demo_Physicians_Active' view
// to the 'Demo_Physicians_Active.json' file
const caspio = require('caspio-sdk')(caspioCredentials);

async function streamViewRecordsToFile() {
  const VIEW_NAME = 'Demo_Physicians_Active';
  const FILE_PATH = 'Demo_Physicians_Active.json';
  await caspio.views.getRecordsStreamToFile(VIEW_NAME, FILE_PATH);
}

streamViewRecordsToFile();

// no return value
Parameters:
Name Type Attributes Default Description
viewName string

Name of view (case-insensitive)

filePath string

Path of file to write to (file path should have an extension of .json)

selectionCriteriaObj Object <optional>
{}

Object that specifies the criteria to be used in constructing the query. Valid properties include the following: select, where, groupBy, and orderBy.

In large part, the query being constructed resembles most queries constructed using SQL (specifically the SQL Server dialect since Caspio uses SQL Server under the hood). Consult a Caspio rep to find which version your account is running on.

Note: Usage of window functions when expecting more than 1000 records is problematic due to being rate-limited at 1000 records per request (hence there's not an effective window within which to operate).

Properties
Name Type Attributes Default Description
select string <optional>
'*'

List of fields separated by comma, where fields may either be fields directly from the specified view or could be a combination of numerous other things:

aliases such as First_Name AS name;

subqueries that return one value such as (SELECT COUNT(User_ID) FROM Demo_Users) AS demo_users_count;

correlated subqueries such as (SELECT Email FROM Users WHERE Participant_ID = _v_Highlighted_Users.Participant_ID), Notable_Highlight when Highlighted_Users is the value of the viewName argument (i.e., the singular view from which records are being pulled);

window functions such as ROW_NUMBER() OVER(PARTITION BY Company, Department ORDER BY Salary DESC, Experience DESC, User_ID) AS comp_dept_sal_rnk to compute salary rankings within departments of a company first by salary amount, years of experience, and finally the User_ID if needed to break ties.

The possibilities are endless--there are numerous possibilities with which to experiment.

Note: If you want to use a view in a correlated subquery as shown above, then be sure to add a prefix of _v_ to the view name, as specified in Caspio's documentation on calculations in reports.

where string <optional>
''

WHERE clause. This is used to find the desired records. You may use subqueries in this clause (e.g., User_ID IN (SELECT ... FROM ... ) among other examples)) as well as AND, OR, etc. Much power can be leveraged by using this clause effectively.

groupBy string <optional>
''

GROUP BY clause. Useful for grouping records by specified fields to consequently make aggregate calculations.

orderBy string <optional>
''

ORDER BY clause. Useful for having SQL Server do the heavy lifting concerning sorting before the response gets transmitted across the wire.

Returns:

No value is returned

Type
void

(static) listing() → {Promise.<Array.<string>>}

Source:
Since:
  • 1.0.0

Returns an array of strings where each string represents an available view for a Caspio account.

Example
// get list of all view names linked to a Caspio account
const caspio = require('caspio-sdk')(caspioCredentials);

async function getViewNames() {
  const viewNames = await caspio.views.listing();
  console.log(viewNames);
  return viewNames;
}

getViewNames();

// sample return value
[
  ...
  'Demo_Admins_Active',
  'Demo_Physicians_Active',
  'Demo_Physicians_Published',
  ...
]
Returns:

Array of strings representing view names for a Caspio account

Type
Promise.<Array.<string>>

(static) updateRecords(viewName, whereClause, newRecordValuesObj, optionsopt) → {Promise.<({status: 200, statusText: 'OK', message: string, recordsAffected: number}|{status: 200, statusText: 'OK', message: string, recordsAffected: number, updatedRecords: Array.<Object>})>}

Source:
Since:
  • 1.0.0

Updates all records in view viewName that match the provided WHERE clause. This method is generally not recommended due to the notes that follow. Directly updating records in a table should always be the preferred route since updating records in a view ultimately results in updating records in a single underlying table.

Note 1 (required conditions for updating view records): Records may only be updated in a view if the view itself only contains a single table or if a particular table in the view has been specified as editable within the view's configuration. This can be done by selecting a table under the "Do you need to edit data using this View?" question when editing a view within Caspio.

Note 2 (updating a view record that results in the record's disappearance from the view): It is possible for a record to be updated in the view but not appear in the updatedRecords array. How? If the record is no longer included in the view after the update, then the record does not appear as one of the records that was updated. For example, if a field value is being used to make the record appear in the view (e.g., Account_Status of true for the Demo_Physicians_Active view), then changing that field value may result in the field being excluded from the view (e.g., changing Account_Status from true to false), which would correspondingly exclude the updated record from the updatedRecords array in the response.

Example
// update records in the 'Demo_Physicians_Active' to have a 'Profile_Status'
// field value of false for all records where the 'Email' field value is 'Lelah.Hoppe@gmail.com'
const caspio = require('caspio-sdk')(caspioCredentials);

async function updateViewRecords() {
  const whereClause = `Email = 'Lelah.Hoppe@gmail.com'`;
  const newValuesObj = {
    Profile_Status: false
  }
  const VIEW_NAME = 'Demo_Physicians_Active';
  const updateResult = await caspio.views.updateRecords(VIEW_NAME, whereClause, newValuesObj, { rows: true });
  console.log(updateResult);
  return updateResult;
}

updateViewRecords();

// sample return value
{
  status: 200,
  statusText: 'OK',
  message: '1 record(s) affected.',
  recordsAffected: 1,
  updatedRecords: [
    {
      Physician_ID: '6T2C9HW8',
      Date_Created: '2020-10-07T04:54:19',
      First_Name: 'Lelah',
      Last_Name: 'Hoppe',
      Full_Name: 'Lelah Hoppe',
      Gender: 'Other',
      Email: 'Lelah.Hoppe@gmail.com',
      Account_Status: true,
      Profile_Status: false,
      Profile_Picture: '/Demo/LelahHoppe.png',
      Specialties: [Object],
      About_Section: 'Exercitationem ... labore.',
      Education_and_Training: 'David Geffen School of Medicine - MD\n' +
        'Yale - Residency, Ophthalmology\n' +
        'Yale - Fellowship, Cataracts and Refractive Surgery',
      Languages_Spoken: [Object],
      Office_Address: '0519 Mustafa Via',
      Office_City: 'New Bradlyhaven',
      Office_State: 'MI',
      Office_Zip: '50198',
      Title: 'Adolescent Medicine Specialist',
      Accepting_New_Patients: true,
      Affiliations: 'American College of Endocrinology\n' +
        'The Endocrine Society\n' +
        'American Diabetes Association',
      Board_Certifications: 'American Board of Pediatrics',
      Office_Name: 'Davis Family Medical Group',
      Office_Phone: '967-841-6054',
      ViewCount: 3654
    }
  ]
}
Parameters:
Name Type Attributes Default Description
viewName string

Name of view (case-insensitive)

whereClause string

WHERE clause (i.e., query to match records to be affected)

newRecordValuesObj object

Object with key-value pairs in the form <fieldName>:<updatedFieldValue>; that is, any provided key should match a field's Name to be updated and the key's value should be the updated value for that field (e.g., { "First_Name": "Updated First Name", "Last_Name": "Updated Last Name" }).

options object <optional>
{ 'rows': '' }

The options object currently only supports the rows option. If no object is provided, then { 'rows': false } is taken as the default value. If an options object is provided with a rows property value of true, then the records updated by the query are returned in the response object as the value for the updatedRecords property; otherwise, the response object does not have an updatedRecords property and no updated records are returned.

Properties
Name Type Attributes Default Description
rows boolean <optional>
false
Returns:

Object with information about the attempted update of the records matched by the WHERE clause (i.e., status, statusText, message, recordsAffected, and updatedRecords if the options argument was passed as { 'rows': true })

Type
Promise.<({status: 200, statusText: 'OK', message: string, recordsAffected: number}|{status: 200, statusText: 'OK', message: string, recordsAffected: number, updatedRecords: Array.<Object>})>