See my previous comment to explain why we do all of this. Its because we changing way the user inputs keys (to make it simpler) to the way Couchdb requires the keys parameter.