Skip to content

Latest commit

 

History

History
147 lines (111 loc) · 5.88 KB

File metadata and controls

147 lines (111 loc) · 5.88 KB

FLEX Function Reference

Complete documentation for all FLEX (FalkorDB Library for EXtensions) functions.

Documentation Template

All function documentation follows a standard template with the following sections:

  • Description
  • Syntax
  • Parameters
  • Returns
  • Examples (with practical use cases)
  • Notes
  • See Also (related functions)

Function Categories

Similarity Functions (flex.sim.*)

Set similarity metrics for fuzzy matching and comparison.

Function Description
sim.jaccard Calculate Jaccard similarity coefficient between sets

Text Functions (flex.text.*)

String manipulation, formatting, case conversion utilities, and string similarity metrics.

Function Description
text.capitalize Capitalize the first character of a string
text.decapitalize Lowercase the first character of a string
text.swapCase Swap the case of all characters in a string
text.camelCase Convert string to camelCase format
text.upperCamelCase Convert string to UpperCamelCase (PascalCase)
text.snakeCase Convert string to snake_case format
text.format Format string with placeholder substitution
text.indexOf Find first occurrence of substring
text.indexesOf Find all occurrences of substring
text.join Join array elements with delimiter
text.lpad Pad string on the left to target length
text.rpad Pad string on the right to target length
text.regexGroups Extract regex matches and capture groups
text.repeat Repeat string multiple times
text.replace Replace text using regex pattern
text.jaroWinkler Compute Jaro-Winkler similarity for short strings
text.levenshtein Compute Levenshtein edit distance between strings

Collection Functions (flex.coll.*)

Operations on lists and arrays including set operations and transformations.

Function Description
coll.zip Combine two lists element-by-element into pairs
coll.union Combine lists and return unique elements
coll.intersection Find common elements between lists
coll.shuffle Randomly shuffle list elements
coll.frequencies Count frequency of each element in list

Map Functions (flex.map.*)

Map/object manipulation for property management and transformation.

Function Description
map.merge Shallow merge multiple maps
map.fromPairs Convert list of key-value pairs to map
map.submap Extract subset of keys from map
map.removeKey Remove single key from map
map.removeKeys Remove multiple keys from map

JSON Functions (flex.json.*)

JSON serialization and parsing utilities.

Function Description
json.toJson Serialize value to JSON string
json.fromJsonMap Parse JSON string to map
json.fromJsonList Parse JSON string to list

Date Functions (flex.date.*)

Date and time manipulation, formatting, and parsing.

Function Description
date.format Format date/time with pattern and timezone
date.parse Parse date/time string with optional pattern
date.truncate Truncate date to specific unit (day, month, etc.)
date.toTimeZone Convert date to timezone offset

Bitwise Functions (flex.bitwise.*)

Low-level bitwise operations on integers.

Function Description
bitwise.and Bitwise AND operation
bitwise.or Bitwise OR operation
bitwise.xor Bitwise XOR (exclusive OR) operation
bitwise.not Bitwise NOT (one's complement) operation
bitwise.shiftLeft Left bit shift operation
bitwise.shiftRight Right bit shift with sign extension

Common Use Cases

Data Cleaning and Normalization

  • text.camelCase, text.snakeCase - Normalize field names
  • text.replace - Remove or sanitize unwanted characters
  • coll.union - Deduplicate lists

Fuzzy Matching and Search

  • text.levenshtein - Find similar strings with edit distance
  • text.jaroWinkler - Match names and short strings
  • sim.jaccard - Compare sets and tag similarity

Data Aggregation and Analysis

  • date.truncate - Group by time periods
  • coll.frequencies - Count occurrences
  • map.submap - Select relevant fields

API and Data Exchange

  • json.toJson, json.fromJsonMap - JSON serialization
  • map.removeKeys - Filter sensitive data
  • text.format - Build formatted messages

Permission and Flag Management

  • bitwise.and, bitwise.or - Check and set permission flags
  • bitwise.xor - Toggle flags

Contributing

When adding new functions, please:

  1. Follow the standard template
  2. Include practical examples with expected output
  3. Document edge cases and null handling
  4. Add "See Also" references to related functions
  5. Update this index with the new function

Version

This documentation is for FLEX v1.0.0+

For more information, see the main README.