Skip to content

Instantly share code, notes, and snippets.

@neumino
Last active August 29, 2015 14:05
Show Gist options
  • Save neumino/dbeff7531db27a09572d to your computer and use it in GitHub Desktop.
Save neumino/dbeff7531db27a09572d to your computer and use it in GitHub Desktop.
r.table('posts').indexStatus('oldIndex').​nth(0).do(function(oldIndex) {
return r.table('posts').indexCreate('newIndex', oldIndex("function"), {multi: oldIndex("multi")}).do(function() {
return r.table('posts').indexWait('newIndex').do(function() {
return r.table('posts').indexRename('newIndex', 'oldIndex', {overwrite: true})
})
})
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment