public function testSort()
{
$this->collection->createDocument(array('p' => 'A'))->save();
$this->collection->createDocument(array('p' => 'B'))->save();
$this->collection->createDocument(array('p' => 'C'))->save();
$documentId = $this->collection->createDocument(array('p' => 'D'))->save()->getId();
$document = $this->collection->find()->sort(array('p' => -1));
$this->assertEquals('D', $document->current()->p);
}