wixdata insert() expected formats?

I’ve set up an endpoint via http-functions that receives a POST request with a JSON body and inserts the body into a collection. It’s nearly identical to the POST request with JSON body example here: wix-http-functions - Velo API Reference - Wix.com

The data is getting inserted in to the database but it is not being parsed in to valid data types. Everything that isn’t being inserted in to a string field is being captured as a string and the collection indicates the data wasn’t captured as the relevant type. I’m not having any luck finding any sort of expected formatting for values.

The three non-text fields I’m trying to insert are:
A date and time into a date and time field
An integer in to a reference field referencing a table whose Title field is only integers
A number with decimals into a number field

How should I be formatting these so that the data is inserted as the expected data type? Thanks.

I’ve managed to solve it, it was mostly lack of javascript understanding. Inside the clause:
return request.body.json()
.then((body) => {

I needed to use another promise as part of a wix-data.query() call, so I set that up following the example code here: https://www.wix.com/code/reference/wix-data.html#query

In order to insert a reference, the inserted value must be the _id field, not the title field as I had thought. I queried the table for a title that matches the value in the JSON body and used the result’s _id as the corresponding field in a new object to be inserted.

I ended up parsing the date to a javascript Date object by way of Date.parse()
Lastly I simply parsed the floating point value with parseFloat()

Again, these all became fields in a new object, and the return(wixData.insert()) call happened inside the results handling clause in the query promise.