Reputation: 784
I understand this command will produce a list of fields ("keys") for a given "document"
r.table('users').get(1).keys()
My question: Is there a command that gives all possible unique key names for all of the documents?
Upvotes: 1
Views: 758
Reputation: 5672
Query:
r.table('users').map(function(doc){
return doc.keys();
}).reduce(function(uniq, doc){
return uniq.setUnion(doc);
}).distinct()
Upvotes: 3