Rethinkdb: How to Rename a Field

You can easily rename any field in your RethinkDB database in two simple steps. You may write this code into a one time script, or you can use the built in Data Explorer to run these commands.

How to rename a field in RethinkDB using JavaScript

1. Copy the value of the field you wish to rename.

r.db('myDataBase').table('peopleTable').update({ newFieldName: r.row('oldFieldName') })

2. Remove the previous field from your data.

r.db('myDataBase').table('peopleTable').replace(function(row) { return row.without("oldFieldName") })

Small dog web development studio
View All Our Posts

Web application developers in western Washington, creating user centric web solutions for businesses of all shapes and sizes.

Our projects include ecommerce, event organization, user driven web applications and more.


Small Dog Studios, LLC. Small Dog Studios News