4 ms·
This is where a nice query/manipulation language come handy http://www.rethinkdb.com/api/#js http://www.rethinkdb.com/api/#js
by dodyg 13y ago
This is where a nice query/manipulation language come handy http://www.rethinkdb.com/api/#js http://www.rethinkdb.com/api/#js
- integraton 13y agoAgreed. PostgreSQL: ALTER TABLE posts RENAME COLUMN author TO writer; MongoDB: db.posts.update({}, {$rename:{"author":"writer"}}, false, true); (I'm excluding RethinkDB since it's still under development and doesn't have a rename command yet)
- orthecreedence 13y agoI don't think it really needs a `rename` command. The query language supports it without: r.table('posts').replace(function(item) { return item.without('author').merge({writer: item('name')}); })
- coffeemug 13y agoThat works, but it is a bit annoying to type. We'll add a porcelain command for this soon. See https://github.com/rethinkdb/rethinkdb/issues/881 https://github.com/rethinkdb/rethinkdb/issues/881.