serialize() public method

Serializes this object storing the collection name instead of the actual MongoDb\Collection (which is unserializable).
public serialize ( ) : string
return string Serialized object.
 /**
  * Serializes this object. Drops the unserializable DriverCursor. In order
  * to make the CacheableCursor object serializable.
  *
  * @return string Serialized object.
  */
 public function serialize()
 {
     $this->documents = $this->cursor = null;
     return parent::serialize();
 }