Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-php-library
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
sinan
mongo-php-library
Commits
09166d3e
Commit
09166d3e
authored
Mar 19, 2018
by
Katherine Walker
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add modifyCollection documentation
parent
44f36ce3
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
118 additions
and
1 deletion
+118
-1
apiargs-MongoDBDatabase-method-modifyCollection-option.yaml
...iargs-MongoDBDatabase-method-modifyCollection-option.yaml
+14
-0
apiargs-MongoDBDatabase-method-modifyCollection-param.yaml
...piargs-MongoDBDatabase-method-modifyCollection-param.yaml
+20
-0
apiargs-common-param.yaml
docs/includes/apiargs-common-param.yaml
+2
-1
MongoDBDatabase.txt
docs/reference/class/MongoDBDatabase.txt
+1
-0
MongoDBDatabase-modifyCollection.txt
docs/reference/method/MongoDBDatabase-modifyCollection.txt
+81
-0
No files found.
docs/includes/apiargs-MongoDBDatabase-method-modifyCollection-option.yaml
0 → 100644
View file @
09166d3e
source
:
file
:
apiargs-common-option.yaml
ref
:
session
---
source
:
file
:
apiargs-MongoDBDatabase-common-option.yaml
ref
:
typeMap
post
:
|
This will be used for the returned command result document.
---
source
:
file
:
apiargs-MongoDBDatabase-common-option.yaml
ref
:
writeConcern
...
docs/includes/apiargs-MongoDBDatabase-method-modifyCollection-param.yaml
0 → 100644
View file @
09166d3e
source
:
file
:
apiargs-common-param.yaml
ref
:
$collectionName
replacement
:
subject
:
"
collection
or
view"
action
:
"
to
modify"
---
arg_name
:
param
name
:
$collectionOptions
type
:
array
description
:
|
Collection or view options to assign.
interface
:
phpmethod
operation
:
~
optional
:
false
---
source
:
file
:
apiargs-common-param.yaml
ref
:
$options
...
docs/includes/apiargs-common-param.yaml
View file @
09166d3e
...
...
@@ -23,11 +23,12 @@ arg_name: param
name
:
$collectionName
type
:
string
description
:
|
The name of the
collection
{{action}}.
The name of the
{{subject}}
{{action}}.
interface
:
phpmethod
operation
:
~
optional
:
false
replacement
:
subject
:
"
collection"
action
:
"
"
---
arg_name
:
param
...
...
docs/reference/class/MongoDBDatabase.txt
View file @
09166d3e
...
...
@@ -56,6 +56,7 @@ Methods
/reference/method/MongoDBDatabase-getTypeMap
/reference/method/MongoDBDatabase-getWriteConcern
/reference/method/MongoDBDatabase-listCollections
/reference/method/MongoDBDatabase-modifyCollection
/reference/method/MongoDBDatabase-selectCollection
/reference/method/MongoDBDatabase-selectGridFSBucket
/reference/method/MongoDBDatabase-withOptions
...
...
docs/reference/method/MongoDBDatabase-modifyCollection.txt
0 → 100644
View file @
09166d3e
=====================================
MongoDB\\Database::modifyCollection()
=====================================
.. versionadded:: 1.4
.. default-domain:: mongodb
.. contents:: On this page
:local:
:backlinks: none
:depth: 1
:class: singlecol
Definition
----------
.. phpmethod:: MongoDB\\Database::modifyCollection()
Modifies a collection or view according to the specified
``$collectionOptions``.
.. code-block:: php
function modifyCollection($collectionName, array $collectionOptions, array $options = []): array|object
This method has the following parameters:
.. include:: /includes/apiargs/MongoDBDatabase-method-modifyCollection-param.rst
The ``$options`` parameter supports the following options:
.. include:: /includes/apiargs/MongoDBDatabase-method-modifyCollection-option.rst
Return Values
-------------
An array or object with the result document of the :manual:`collMod
</reference/command/collMod>` command.
Errors/Exceptions
-----------------
.. include:: /includes/extracts/error-invalidargumentexception.rst
.. include:: /includes/extracts/error-driver-runtimeexception.rst
Example
-------
The following example changes the expiration time of a TTL collection in the
``test`` database:
.. code-block:: php
<?php
$db = (new MongoDB\Client)->test;
$result = $db->modifyCollection('users', [
'keyPattern' => ['lastAccess' => 1],
'expireAfterSeconds' => 1000
]);
var_dump($result);
The output would then resemble::
object(stdClass)#2779 {
["expireAfterSeconds_old"]=>
int(3)
["expireAfterSeconds_new"]=>
int(1000)
["ok"]=>
float(1)
}
See Also
--------
- :manual:`collMod </reference/command/collMod>` command reference in the MongoDB
manual
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment