Created
September 15, 2021 01:14
-
-
Save dfellis/de8dadf1a1a953c885dff5f1433d4b7a to your computer and use it in GitHub Desktop.
Remote Execution First Example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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