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

Function getVotes

cloud-sql/postgres/knex/index.js:189–195  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

187 * @returns {Promise}
188 */
189const getVotes = async pool => {
190 return await pool
191 .select('candidate', 'time_cast')
192 .from('votes')
193 .orderBy('time_cast', 'desc')
194 .limit(5);
195};
196
197/**
198 * Retrieve the total count of records for a given candidate

Callers 1

httpGetFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected