rethinkdb / rethinkdb

The open-source database for the realtime web.
https://rethinkdb.com
Other
26.76k stars 1.86k forks source link

Feature Request: table keys as accessible metadata #4469

Open thelinuxlich opened 9 years ago

thelinuxlich commented 9 years ago

Right now if I need this I would have to iterate all records which is not performant:

<REQL query>.map(function(row){ return row.keys() }).distinct()

And it lacks nested keys information. It would be nice if RethinkDB stored this information as metadata easily accessible for us. Furthermore, the user could configure this "field capture" on a index basis.

danielmewes commented 9 years ago

This would be useful for things like https://github.com/rethinkdb/rethinkdb/issues/4397 .

I think it would need to be an optional feature for a given table, since some users have dynamically generated keys and the number of keys used might grow unboundedly.

Putting into backlog for now, we should look at it when we have decided on a solution for #4397.

thelinuxlich commented 9 years ago

Yeah I think it should be configured on table creation