Comment 0 for bug 1217963

Revision history for this message
Cris Dywan (kalikiana) wrote :

The reference implementarion has a feature called transformation functions:

http://pythonhosted.org/u1db/high-level-api.html#index-expressions

lower(index_expression) - lowercase the value
split_words(index_expression) - split the value on whitespace; will act like a list and add multiple entries to the index
number(index_expression, width) - takes an integer value, and turns it into a string, left padded with zeroes, to make it at least as wide as width; or nothing if the field type is not an integer.
bool(index_expression) - takes a boolean value and turns it into ‘0’ if false and ‘1’ if true, or nothing if the field type is not boolean.
combine(index_expression1, index_expression2, ...) - Combine the values of an arbitrary number of sub expressions into a single index.