vault backup: 2023-11-03 21:23:31

This commit is contained in:
Paul Trowbridge 2023-11-03 21:23:31 -04:00
parent 29e7be99f3
commit 55d950d010

14
api.ts
View File

@ -32,7 +32,19 @@ await client.connect();
const query = await Deno.readTextFile("sql/get.pg.sql");
function apply_guidance(doc: any) {
return doc;
if (doc["hist"]["chan.mold.v0ds.vers"] && Array.isArray(doc["hist"]["chan.mold.v0ds.vers"])) {
// Loop through each element in the 'chan.mold.v0ds.vers' array
for (const element of doc["hist"]["chan.mold.v0ds.vers"]) {
// Process each element - 'element' is of type SeasonData
console.log(element); // Replace with actual processing logic
}
} else {
// Handle the case where 'chan.mold.v0ds.vers' is not an array or doesn't exist
console.error("'chan.mold.v0ds.vers' is not an array or does not exist in the document.");
}
return doc;
}
// Define a route to retrieve values from the database using parameters