Skip to content
Luke Bakken edited this page Oct 5, 2016 · 1 revision

Matching Records in a Map Phase with a Regex

Source File on GitHub

As you can see, this is a simple function written in JavaScript. Its original use was to return keys that match a given regex.

This is the entirety of the function:

function keyMatch(value, arg){ 
  if (value.values[0].data.match(arg)) { 
    return [value.key] 
  } else {
    return []
  }
}