diff --git a/src/Fabs/CouchDB2/Query/Queries/GetAllDocsDBQuery.php b/src/Fabs/CouchDB2/Query/Queries/GetAllDocsDBQuery.php
index <HASH>..<HASH> 100644
--- a/src/Fabs/CouchDB2/Query/Queries/GetAllDocsDBQuery.php
+++ b/src/Fabs/CouchDB2/Query/Queries/GetAllDocsDBQuery.php
@@ -103,7 +103,7 @@ class GetAllDocsDBQuery extends DBQuery
      */
     public function setKeys($value)
     {
-        $this->query_data['keys'] = $value;
+        $this->query_data['keys'] = array_values($value);
         return $this;
     }
 
diff --git a/src/Fabs/CouchDB2/Query/Queries/GetViewDBQuery.php b/src/Fabs/CouchDB2/Query/Queries/GetViewDBQuery.php
index <HASH>..<HASH> 100644
--- a/src/Fabs/CouchDB2/Query/Queries/GetViewDBQuery.php
+++ b/src/Fabs/CouchDB2/Query/Queries/GetViewDBQuery.php
@@ -122,7 +122,7 @@ class GetViewDBQuery extends DBQuery
      */
     public function setKeys($value)
     {
-        $this->query_data['keys'] = $value;
+        $this->query_data['keys'] = array_values($value);
         return $this;
     }
FIX keys assoc problem