Loading…

BitBadger.Documents
Upgrade from v3.x to v4

The Quick Version

ByField to ByFields and PostgreSQL Numbers

All methods/functions that ended with ByField now end with ByFields, and take a FieldMatch case (Any equates to OR, All equates to AND) and sequence of Field objects. These Fields need to have their values as well, because the PostgreSQL library will now cast the field from the document to numeric and bind the parameter as-is.

That is an action-packed paragraph; these changes have several ripple effects throughout the library:

Op Type Removal

The Op type has been replaced with a Comparison type which captures both the type of comparison and the object of the comparison in one type. This is considered an internal implementation detail, as that type was not intended for use outside the library; however, it was public, so its removal warrants at least a mention.

Additionally, the addition of In and InArray field comparisons drove a change to the Field type's static creation functions. These now have the comparison spelled out, as opposed to the two-to-three character abbreviations. (These abbreviated functions still exists as aliases, so this change will not result in compile errors.) The functions to create fields are:

Old New
EQ Equal
GT Greater
GE GreaterOrEqual
LT Less
LE LessOrEqual
NE NotEqual
BT Between
IN In (since v4 rc1)
InArray (v4 rc4)
EX Exists
NEX NotExists