diff --git a/src/Sokil/Mongo/Collection.php b/src/Sokil/Mongo/Collection.php
index <HASH>..<HASH> 100644
--- a/src/Sokil/Mongo/Collection.php
+++ b/src/Sokil/Mongo/Collection.php
@@ -41,7 +41,13 @@ class Collection
         return $this;
     }
     
-    public function getDocumentClassName()
+    /**
+     * Override to define classname of document by document data
+     * 
+     * @param array $documentData
+     * @return string Document class data
+     */
+    public function getDocumentClassName(array $documentData = null)
     {
         return $this->_docClass;
     }
diff --git a/src/Sokil/Mongo/Search.php b/src/Sokil/Mongo/Search.php
index <HASH>..<HASH> 100644
--- a/src/Sokil/Mongo/Search.php
+++ b/src/Sokil/Mongo/Search.php
@@ -132,7 +132,7 @@ class Search implements \Iterator, \Countable
             return null;
         }
         
-        $className = $this->_collection->getDocumentClassName();
+        $className = $this->_collection->getDocumentClassName($documentData);
         return new $className($documentData);
     }
pass document array to mathod which returns document's class name