Skip to content

Instantly share code, notes, and snippets.

@codedmart
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save codedmart/1e1679c6c4e23314f879 to your computer and use it in GitHub Desktop.

Select an option

Save codedmart/1e1679c6c4e23314f879 to your computer and use it in GitHub Desktop.
r.db('lumi').table('users').coerceTo('array').filter(function(row){
return row('username').match('[^a-zA-Z0-9_]')
}).update({
username: r.row('username').coerceTo('string').replace(/[^a-zA-Z0-9_]/gi, '')
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment