I found this F# JSON parsing - How to get property using complex path (consisting of several propery names) (I shortened the file string). I am wondering how to show the actual data from the json file in the FSI window?
let soilTest = JsonValue.Load("c:\\,,,soiltest.json")
let query soilTest=
let node = JObject.Parse soilTest
node.SelectToken "person[0].name" |> string
Here is the beginning of the json file:
{
"person": [
{
"name": "John Doe",
"date": "December 1, 2015",
.....
I looked at the link that Mark Seemann provided to see how to get the data out of the json file and be shown in the console.
However when putting
Console.WriteLine(name)
I get this warning:
warning FS0020: This expression should have type 'unit', but has type 'string'. Use 'ignore' to discard the result of the expression, or 'let' to bind the result to a name.
val query : soilTest:string -> unit
Tried |>ignore at the end of console.writeline and I get val query : soulTest:string -> unit
How do you do a let statement from this point to bind the data to it?