Skip to content

Instantly share code, notes, and snippets.

@dfellis
Created September 15, 2021 01:14
Show Gist options
  • Save dfellis/5177bc5f566228f727640baba05fc7af to your computer and use it in GitHub Desktop.
Save dfellis/5177bc5f566228f727640baba05fc7af to your computer and use it in GitHub Desktop.
Remote Execution Second Example
const userTripsInOrder = await query(`
select * from trips
where trips.userId == $0
order by trips.startTime desc;
`, [userId]);
const outputUserTripsInOrder = userTripsInOrder.map((t) => ({
type: t.type,
price: t.price,
serviceProvider, t.serviceProvider,
origin: {
lat: t.originLat,
lng: t.originLng,
time: new Date(t.startTime),
},
destination: {
lat: t.destLat,
lng: t.destLng,
time: new Date(t.endTime),
},
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment