Skip to content

Instantly share code, notes, and snippets.

@dfellis
Created September 15, 2021 01:14
Show Gist options
  • Save dfellis/de8dadf1a1a953c885dff5f1433d4b7a to your computer and use it in GitHub Desktop.
Save dfellis/de8dadf1a1a953c885dff5f1433d4b7a to your computer and use it in GitHub Desktop.
Remote Execution First Example
const trips = await query(`select * from trips;`);
const userTripsInOrder = trips
.filter((t) => t.userId === userId)
.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),
},
})
.sort((a, b) => a.origin.time - b.origin.time);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment