Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
This commit adds the new tilde '~' operator, which when used will convert a value to a boolean before comparison. For example, using the following JSON: { "vals": [ { "a": 1, "b": true }, { "a": 2, "b": true }, { "a": 3, "b": false }, { "a": 4, "b": "0" }, { "a": 5, "b": 0 }, { "a": 6, "b": "1" }, { "a": 7, "b": 1 } { "a": 8, "b": "true" }, { "a": 9, "b": false } { "a": 10, "b": null } { "a": 11 } ] } You can now query for all true(ish) values: vals.#(b==~true)# Which returns: [1,2,6,7,8] Or all false(ish) values: vals.#(b==~false)# Which returns: [3,4,5,9,10,11] The last value which was non-existent is treated as "false"
- Loading branch information