Skip to content

DOCSP-44608: merge v2 into master #174

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 22 commits into from
Oct 28, 2024
Merged
Show file tree
Hide file tree
Changes from 20 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion snooty.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,6 @@ toc_landing_pages = [
"/reference/class/MongoDBInsertManyResult",
"/reference/class/MongoDBUpdateResult",
"/reference/class/MongoDBChangeStream",
"/reference/class/MongoDBMapReduceResult",
"/reference/class/MongoDBModelCollectionInfo",
"/reference/class/MongoDBModelDatabaseInfo",
"/reference/class/MongoDBModelIndexInfo",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@

// Explicitly creates the "example_collection" collection
// start-create-collection
$result = $client->test_database->createCollection('example_collection');
$client->test_database->createCollection('example_collection');
// end-create-collection

// Lists the collections in the "test_database" database
Expand Down
2 changes: 1 addition & 1 deletion source/includes/databases-collections/time-series.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
]
];

$collection = $db->createCollection('sept2023', $options);
$db->createCollection('sept2023', $options);
// end-create-ts

// Lists the collections in the "precipitation" database
Expand Down
2 changes: 1 addition & 1 deletion source/includes/read/cursor.php
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
// Creates a collection with a maximum size and inserts documents representing vegetables
// start-capped-coll
$db = $client->db;
$create_coll = $db->createCollection(
$db->createCollection(
'vegetables',
['capped' => true, 'size' => 1024 * 1024]
);
Expand Down
119 changes: 119 additions & 0 deletions source/includes/reference/find-one-parameters.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,119 @@
``$filter`` : array|object
The filter criteria that specifies the documents to query.

``$options`` : array
An array specifying the desired options.

.. list-table::
:header-rows: 1
:widths: 20 20 80

* - Name
- Type
- Description

* - allowDiskUse
- boolean
- Enables writing to temporary files. When set to ``true``, queries can
write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.

* - allowPartialResults
- boolean
- For queries against a sharded collection, returns partial results from
the :program:`mongos` if some shards are unavailable instead of
throwing an error.

* - codec
- MongoDB\\Codec\\DocumentCodec
- .. include:: /includes/extracts/collection-option-codec.rst

.. versionadded:: 1.17

* - collation
- array|object
- .. include:: /includes/extracts/collection-option-collation.rst

* - comment
- mixed
- .. include:: /includes/extracts/common-option-comment.rst

.. include:: /includes/extracts/common-option-comment-string-before-4.4.rst

* - hint
- string|array|object
- .. include:: /includes/extracts/common-option-hint.rst

.. versionadded:: 1.2

* - let
- array|object
- .. include:: /includes/extracts/common-option-let.rst

.. versionadded:: 1.13

* - max
- array|object
- The exclusive upper bound for a specific index.

.. versionadded:: 1.2

* - maxTimeMS
- integer
- .. include:: /includes/extracts/common-option-maxTimeMS.rst

* - min
- array|object
- The inclusive lower bound for a specific index.

.. versionadded:: 1.2

* - projection
- array|object
- The :ref:`projection specification <projections>` to determine which
fields to include in the returned documents. See
:manual:`Project Fields to Return from Query </tutorial/project-fields-from-query-results>`
and :manual:`Projection Operators </reference/operator/projection>` in
the MongoDB manual.

* - readConcern
- :php:`MongoDB\Driver\ReadConcern <class.mongodb-driver-readconcern>`
- .. include:: /includes/extracts/collection-option-readConcern.rst

.. include:: /includes/extracts/common-option-readConcern-transaction.rst

* - readPreference
- :php:`MongoDB\Driver\ReadPreference <class.mongodb-driver-readpreference>`
- .. include:: /includes/extracts/collection-option-readPreference.rst

* - returnKey
- boolean
- If true, returns only the index keys in the resulting documents.

.. versionadded:: 1.2

* - session
- :php:`MongoDB\Driver\Session <class.mongodb-driver-session>`
- .. include:: /includes/extracts/common-option-session.rst

.. versionadded:: 1.3

* - showRecordId
- boolean
- Determines whether to return the record identifier for each document.
If true, adds a field ``$recordId`` to the returned documents.

.. versionadded:: 1.2

* - skip
- integer
- Number of documents to skip. Defaults to ``0``.

* - sort
- array|object
- The sort specification for the ordering of the results.

* - typeMap
- array
- .. include:: /includes/extracts/collection-option-typeMap.rst

This will be used for the returned result document.
160 changes: 160 additions & 0 deletions source/includes/reference/find-parameters.rst
Original file line number Diff line number Diff line change
@@ -0,0 +1,160 @@
``$filter`` : array|object
The filter criteria that specifies the documents to query.

``$options`` : array
An array specifying the desired options.

.. list-table::
:header-rows: 1
:widths: 20 20 80

* - Name
- Type
- Description

* - allowDiskUse
- boolean
- Enables writing to temporary files. When set to ``true``, queries can
write data to the ``_tmp`` sub-directory in the ``dbPath`` directory.

* - allowPartialResults
- boolean
- For queries against a sharded collection, returns partial results from
the :program:`mongos` if some shards are unavailable instead of
throwing an error.

* - batchSize
- integer
- The number of documents to return in the first batch. Defaults to
``101``. A batchSize of ``0`` means that the cursor will be
established, but no documents will be returned in the first batch.

Unlike the previous wire protocol version, a batchSize of ``1`` for the
:dbcommand:`find` command does not close the cursor.

* - codec
- MongoDB\\Codec\\DocumentCodec
- .. include:: /includes/extracts/collection-option-codec.rst

.. versionadded:: 1.17

* - collation
- array|object
- .. include:: /includes/extracts/collection-option-collation.rst

* - comment
- mixed
- .. include:: /includes/extracts/common-option-comment.rst

.. include:: /includes/extracts/common-option-comment-string-before-4.4.rst

* - cursorType
- integer
- Indicates the type of cursor to use. ``cursorType`` supports the
following values:

- ``MongoDB\Operation\Find::NON_TAILABLE`` (*default*)
- ``MongoDB\Operation\Find::TAILABLE``

* - hint
- string|array|object
- .. include:: /includes/extracts/common-option-hint.rst

.. versionadded:: 1.2

* - let
- array|object
- .. include:: /includes/extracts/common-option-let.rst

.. versionadded:: 1.13

* - limit
- integer
- The maximum number of documents to return. If unspecified, then
defaults to no limit. A limit of ``0`` is equivalent to setting no
limit.

A negative limit is similar to a positive limit but closes the cursor
after returning a single batch of results. As such, with a negative
limit, if the limited result set does not fit into a single batch, the
number of documents received will be less than the specified limit. By
passing a negative limit, the client indicates to the server that it
will not ask for a subsequent batch by using getMore.

* - max
- array|object
- The exclusive upper bound for a specific index.

.. versionadded:: 1.2

* - maxAwaitTimeMS
- integer
- Positive integer denoting the time limit in milliseconds for the server
to block a getMore operation if no data is available. This option
should only be used if cursorType is ``TAILABLE_AWAIT``.

.. versionadded:: 1.2

* - maxTimeMS
- integer
- .. include:: /includes/extracts/common-option-maxTimeMS.rst

* - min
- array|object
- The inclusive lower bound for a specific index.

.. versionadded:: 1.2

* - noCursorTimeout
- boolean
- Prevents the server from timing out idle cursors after an inactivity
period (10 minutes).

* - projection
- array|object
- The :ref:`projection specification <projections>` to determine which
fields to include in the returned documents. See
:manual:`Project Fields to Return from Query </tutorial/project-fields-from-query-results>`
and :manual:`Projection Operators </reference/operator/projection>` in
the MongoDB manual.

* - readConcern
- :php:`MongoDB\Driver\ReadConcern <class.mongodb-driver-readconcern>`
- .. include:: /includes/extracts/collection-option-readConcern.rst

.. include:: /includes/extracts/common-option-readConcern-transaction.rst

* - readPreference
- :php:`MongoDB\Driver\ReadPreference <class.mongodb-driver-readpreference>`
- .. include:: /includes/extracts/collection-option-readPreference.rst

* - returnKey
- boolean
- If true, returns only the index keys in the resulting documents.

.. versionadded:: 1.2

* - session
- :php:`MongoDB\Driver\Session <class.mongodb-driver-session>`
- .. include:: /includes/extracts/common-option-session.rst

.. versionadded:: 1.3

* - showRecordId
- boolean
- Determines whether to return the record identifier for each document.
If true, adds a field ``$recordId`` to the returned documents.

.. versionadded:: 1.2

* - skip
- integer
- Number of documents to skip. Defaults to ``0``.

* - sort
- array|object
- The sort specification for the ordering of the results.

* - typeMap
- array
- .. include:: /includes/extracts/collection-option-typeMap.rst
3 changes: 0 additions & 3 deletions source/indexes/index-mgmt.txt
Original file line number Diff line number Diff line change
Expand Up @@ -127,9 +127,6 @@ You can delete all indexes by calling the
:end-before: end-remove-all-indexes
:dedent:

The ``dropIndexes()`` method returns information about the number of
indexes removed and a success message.

API Documentation
~~~~~~~~~~~~~~~~~

Expand Down
2 changes: 0 additions & 2 deletions source/reference/class/MongoDBCollection.txt
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,6 @@ Methods
insertOne() </reference/method/MongoDBCollection-insertOne>
listIndexes() </reference/method/MongoDBCollection-listIndexes>
listSearchIndexes() </reference/method/MongoDBCollection-listSearchIndexes>
mapReduce() </reference/method/MongoDBCollection-mapReduce>
rename() </reference/method/MongoDBCollection-rename>
replaceOne() </reference/method/MongoDBCollection-replaceOne>
updateMany() </reference/method/MongoDBCollection-updateMany>
Expand Down Expand Up @@ -122,7 +121,6 @@ Methods
- :phpmethod:`MongoDB\Collection::insertOne()`
- :phpmethod:`MongoDB\Collection::listIndexes()`
- :phpmethod:`MongoDB\Collection::listSearchIndexes()`
- :phpmethod:`MongoDB\Collection::mapReduce()`
- :phpmethod:`MongoDB\Collection::rename()`
- :phpmethod:`MongoDB\Collection::replaceOne()`
- :phpmethod:`MongoDB\Collection::updateMany()`
Expand Down
34 changes: 0 additions & 34 deletions source/reference/class/MongoDBMapReduceResult.txt

This file was deleted.

7 changes: 4 additions & 3 deletions source/reference/class/MongoDBModelCollectionInfo.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,10 @@ Definition

.. phpclass:: MongoDB\Model\CollectionInfo

This class models information about a collection. Instances of this class are
returned by traversing a :phpclass:`MongoDB\Model\CollectionInfoIterator`,
which is returned by :phpmethod:`MongoDB\Database::listCollections()`.
This class models information about a collection. Instances of this
class are returned by traversing an :php:`Iterator
<manual/en/class.iterator.php>`, which is returned by the
:phpmethod:`MongoDB\Database::listCollections()` method.

.. versionchanged:: 1.4

Expand Down
Loading
Loading