json-fs-query 2.1.0 → 2.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +8 -0
- package/browser/jsonFsQuery.js +562 -390
- package/browser/jsonFsQuery.min.js +1 -1
- package/dist/data/queries/sortBy.d.ts +6 -0
- package/dist/data/queries/sortBy.js +13 -4
- package/dist/data/queries/sortBy.min.js +1 -1
- package/dist/data/queries/where.js +8 -6
- package/dist/data/queries/where.min.js +1 -1
- package/dist/data/utilities/getConditionIndexedList.d.ts +13 -1
- package/dist/data/utilities/getConditionIndexedList.js +46 -11
- package/dist/data/utilities/getConditionIndexedList.min.js +1 -1
- package/dist/data/utilities/getMatchingIndexes.js +2 -2
- package/dist/data/utilities/getMatchingIndexes.min.js +1 -1
- package/dist/data/utilities/isSingleFieldKey.d.ts +10 -0
- package/dist/data/utilities/isSingleFieldKey.js +15 -0
- package/dist/data/utilities/isSingleFieldKey.min.js +1 -0
- package/dist/data/utilities/parsers/findSortClauses.d.ts +1 -0
- package/dist/data/utilities/retrieveIndexes.js +2 -2
- package/dist/data/utilities/retrieveIndexes.min.js +1 -1
- package/dist/data/utilities/runQuery.js +35 -18
- package/dist/data/utilities/runQuery.min.js +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -148,6 +148,14 @@ read workouts where reps > 8 and where date = '2024-06-02'
|
|
|
148
148
|
`or where` is not supported yet, and is an error (in 1.x it was silently read as `and where`). And/or with grouping
|
|
149
149
|
and precedence is planned.
|
|
150
150
|
|
|
151
|
+
### Comparing by the field's type
|
|
152
|
+
|
|
153
|
+
Conditions compare by the field's declared type, whatever type the stored value or the literal has: in a `string`
|
|
154
|
+
or `int` field, `'3'` and `3` are equal. Ordering (`>`, `>=`, `<`, `<=`, `between`) and `sort` follow it too: a
|
|
155
|
+
`string` field orders as text, so `'10'` comes before `'9'` (even ids stored as numbers), and an `int` field as
|
|
156
|
+
numbers. A field with no declared type, or an `object` or `array` one, compares the stored values as they are.
|
|
157
|
+
`like` only matches values stored as text.
|
|
158
|
+
|
|
151
159
|
### Null and missing fields
|
|
152
160
|
|
|
153
161
|
A field can be missing (left out) or hold `null`, and both are their own cases, as in SQL: they match no
|