This is how YAML file looks:
Moreover, order matters in list but it does not matter in dictionary
Json and Json Path
In Json, things are bit different. Using brackets like 2nd bracket and third one.
Here you can see yaml used spaces and json used "{}"
For lists, yaml uses "-" where as json uses "[]"
Use this Json to Yaml converter
Json Path
Query language applied in json or yaml format.
If there is no dictionary mentioned, it means root dictionary and we use $ in json path to mean that.
The results will be in square brackets.
This is how we use indexing here.
We can also find numbers greater than 40 by this:
Here ? means check if
@ means each item and others are conditions like (> , ! etc)
We could also filter car models using their locations by this
here, @.location means checking each item's(index 0,1,2,3) location and then if they find a value of rear-right in any location, that is the desired item.
Here our desired item is index 1 and then we get the value of the model.
Take part in the labs
Just like this...
After successfully completing these,
You can also do a free course from KodeKloud
Top comments (0)