diff --git a/source/read/change-streams.txt b/source/read/change-streams.txt index a74b0814..45c869b0 100644 --- a/source/read/change-streams.txt +++ b/source/read/change-streams.txt @@ -38,7 +38,7 @@ database from the :atlas:`Atlas sample datasets `. To access this from your PHP application, instantiate a ``MongoDB\Client`` that connects to an Atlas cluster and assign the following value to your ``$collection`` variable: -.. literalinclude:: /includes/read/change/streams/change-stream.php +.. literalinclude:: /includes/read/change-streams/change-stream.php :language: php :dedent: :start-after: start-db-coll diff --git a/source/reference/class/MongoDBModelCollectionInfo.txt b/source/reference/class/MongoDBModelCollectionInfo.txt index a869b322..21b2dbb9 100644 --- a/source/reference/class/MongoDBModelCollectionInfo.txt +++ b/source/reference/class/MongoDBModelCollectionInfo.txt @@ -39,6 +39,7 @@ Methods getOptions() getType() isCapped() + isView() - :phpmethod:`MongoDB\Model\CollectionInfo::getCappedMax()` - :phpmethod:`MongoDB\Model\CollectionInfo::getCappedSize()` @@ -47,4 +48,5 @@ Methods - :phpmethod:`MongoDB\Model\CollectionInfo::getName()` - :phpmethod:`MongoDB\Model\CollectionInfo::getOptions()` - :phpmethod:`MongoDB\Model\CollectionInfo::getType()` -- :phpmethod:`MongoDB\Model\CollectionInfo::isCapped()` \ No newline at end of file +- :phpmethod:`MongoDB\Model\CollectionInfo::isCapped()` +- :phpmethod:`MongoDB\Model\CollectionInfo::isView()` diff --git a/source/reference/method/MongoDBModelCollectionInfo-isView.txt b/source/reference/method/MongoDBModelCollectionInfo-isView.txt new file mode 100644 index 00000000..54ffebe3 --- /dev/null +++ b/source/reference/method/MongoDBModelCollectionInfo-isView.txt @@ -0,0 +1,52 @@ +======================================== +MongoDB\\Model\\CollectionInfo::isView() +======================================== + +.. contents:: On this page + :local: + :backlinks: none + :depth: 1 + :class: singlecol + +Definition +---------- + +.. phpmethod:: MongoDB\Model\CollectionInfo::isView() + + Return whether the collection is a :manual:`view `. + + .. code-block:: php + + function isView(): boolean + +Return Values +------------- + +A boolean indicating whether the collection is a view. + +Examples +-------- + +.. code-block:: php + + 'foo', + 'type' => 'view', + 'info' => ['readOnly' => true], + ]); + + var_dump($info->isView()); + +The output resembles the following: + +.. code-block:: none + + bool(true) + +See Also +-------- + +- :manual:`Views ` in the {+mdb-server+} manual +- :manual:`Create and Query a View ` in the {+mdb-server+} manual diff --git a/source/whats-new.txt b/source/whats-new.txt index 102da67e..548e9929 100644 --- a/source/whats-new.txt +++ b/source/whats-new.txt @@ -20,6 +20,7 @@ What's New Learn about new features, improvements, and fixes introduced in the following versions of the {+php-library+}: +* :ref:`Version 2.2 ` * :ref:`Version 2.1 ` * :ref:`Version 2.0 ` * :ref:`Version 1.21 ` @@ -28,6 +29,17 @@ following versions of the {+php-library+}: * :ref:`Version 1.18 ` * :ref:`Version 1.17 ` +.. _php-lib-version-2.2: + +What's New in 2.2 +----------------- + +The {+library-short+} v2.2 release includes the following features, +improvements, and fixes: + +- Adds the :phpmethod:`MongoDB\Model\CollectionInfo::isView()` method to + determine whether a collection is a :manual:`view `. + .. _php-lib-version-2.1: What's New in 2.1