public function toRefArray()
    {
        // Retrieve the actual objects.
        $documents = $this->toArray();

        // Get the collection idenfitier
        $collection = (string) $this->collection->getCollection();

        foreach ($documents as &$document) {
            $document = MongoDBRef::create($collection, $document);
        }

        return $documents;
    }