-
v3 (RC 2) Pre-Release
released this
2024-01-24 02:23:24 +00:00 | 22 commits to main since this releaseRelease Candidate 2
- Uses
Field
type for by-field queries (BREAKING)
For by-field queries using RC 1, the functions required three parameters: the field name, an operator, and a value. The query building functions took just the name and operator, and the parameter building functions required just the name and value. Now, there is a
Field
type for this criteria, and it incorporates all three items. It has functions to create these easily, and they follow the form ofField.OP(name, value)
. (EX
andNEX
require no value.)This is a breaking change; what used to be three parameters (
"FieldName" EQ 22
) is now a function call (Field.EQ("FieldName", 22)
in C# or(Field.EQ "FieldName" 22)
in F#). Also, thoughvalue
is defined asobj
/object
, PostgreSQL only recognizes string values; SQLite allows strings, numbers, and boolean values.- Adds
RemoveFields*
functions
While the
Patch*
functions can be used to update portions of documents (including setting fields tonull
), if the calling application has the JSON serializer set to ignorenull
values, thenull
field is removed from the patch document, so the destination document is not updated. While a full update would replace the document, a better option here is to remove the fields from the document. These functions take anIEnumerable<string>
(C#) orstring list
(F#) as their final parameter, and will remove the specified fields from the matching documents (by-ID, by-field for both, by-contains and by-JSON-path for PostgreSQL). (If using .NET 8/C# 12, this is a great place for the new collection syntax[ "Field1", "Field2" ]
.)
Packages are available on NuGet.
Downloads
- Uses