MCPcopy Create free account
hub / github.com/GoogleCloudPlatform/nodejs-docs-samples / getVotes

Function getVotes

run/idp-sql/cloud-sql.js:108–115  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

106 * @returns {Promise}
107 */
108const getVotes = async () => {
109 if (!knex) knex = await connect();
110 return knex
111 .select('candidate', 'time_cast', 'uid')
112 .from(TABLE)
113 .orderBy('time_cast', 'desc')
114 .limit(5);
115};
116
117/**
118 * Retrieve the total count of records for a given candidate

Callers 1

app.jsFile · 0.70

Calls 1

connectFunction · 0.70

Tested by

no test coverage detected