Skip to content

Instantly share code, notes, and snippets.

@codedmart
Created September 10, 2015 22:01
Show Gist options
  • Select an option

  • Save codedmart/5b61062780373407a2de to your computer and use it in GitHub Desktop.

Select an option

Save codedmart/5b61062780373407a2de to your computer and use it in GitHub Desktop.
table = db.table('orderItems').filter({'kitId': kit['id']})
table.replace(lambda row:
r.branch(
row.has_fields('orderedKit'),
row.without('kitId', 'orderedKit').merge({'buildId': row['buildId'], 'orderedBuild': row['orderedKit']}),
row.without('kitId').merge({'buildId': row['buildId']})
)
).run()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment