Skip to content

Commit 4955333

Browse files
committed
PHPLIB-221: API documentation for MongoDB\GridFS\Bucket
1 parent b33e5a5 commit 4955333

File tree

37 files changed

+1070
-0
lines changed

37 files changed

+1070
-0
lines changed
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
arg_name: option
2+
name: bucketName
3+
type: string
4+
description: |
5+
The bucket name, which will be used as a prefix for the files and chunks
6+
collections. Defaults to ``"fs"``.
7+
interface: phpmethod
8+
operation: MongoDB\\Database::selectGridFSBucket
9+
optional: true
10+
position: 1
11+
---
12+
arg_name: option
13+
name: chunkSizeBytes
14+
type: integer
15+
description: |
16+
The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
17+
interface: phpmethod
18+
operation: MongoDB\\Database::selectGridFSBucket
19+
optional: true
20+
position: 2
21+
---
22+
source:
23+
file: apiargs-common-option.yaml
24+
ref: readConcern
25+
operation: MongoDB\\Database::selectGridFSBucket
26+
position: 3
27+
replacement:
28+
resource: "bucket"
29+
parent: "database"
30+
---
31+
source:
32+
file: apiargs-common-option.yaml
33+
ref: readPreference
34+
operation: MongoDB\\Database::selectGridFSBucket
35+
position: 4
36+
replacement:
37+
resource: "bucket"
38+
parent: "database"
39+
---
40+
source:
41+
file: apiargs-common-option.yaml
42+
ref: writeConcern
43+
operation: MongoDB\\Database::selectGridFSBucket
44+
position: 5
45+
replacement:
46+
resource: "bucket"
47+
parent: "database"
48+
...
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
source:
2+
file: apiargs-common-param.yaml
3+
ref: $options
4+
operation: MongoDB\\Database::selectGridFSBucket
5+
position: 1
6+
...
Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
arg_name: option
2+
name: bucketName
3+
type: string
4+
description: |
5+
The bucket name, which will be used as a prefix for the files and chunks
6+
collections. Defaults to ``"fs"``.
7+
interface: phpmethod
8+
operation: MongoDB\\GridFS\\Bucket::__construct
9+
optional: true
10+
position: 1
11+
---
12+
arg_name: option
13+
name: chunkSizeBytes
14+
type: integer
15+
description: |
16+
The chunk size in bytes. Defaults to ``261120`` (i.e. 255 KiB).
17+
interface: phpmethod
18+
operation: MongoDB\\GridFS\\Bucket::__construct
19+
optional: true
20+
position: 2
21+
---
22+
source:
23+
file: apiargs-common-option.yaml
24+
ref: readConcern
25+
operation: MongoDB\\GridFS\\Bucket::__construct
26+
position: 3
27+
replacement:
28+
resource: "bucket"
29+
parent: "database"
30+
---
31+
source:
32+
file: apiargs-common-option.yaml
33+
ref: readPreference
34+
operation: MongoDB\\GridFS\\Bucket::__construct
35+
position: 4
36+
replacement:
37+
resource: "bucket"
38+
parent: "database"
39+
---
40+
source:
41+
file: apiargs-common-option.yaml
42+
ref: writeConcern
43+
operation: MongoDB\\GridFS\\Bucket::__construct
44+
position: 5
45+
replacement:
46+
resource: "bucket"
47+
parent: "database"
48+
...
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
source:
2+
file: apiargs-common-param.yaml
3+
ref: $manager
4+
operation: MongoDB\\GridFS\\Bucket::__construct
5+
position: 1
6+
---
7+
source:
8+
file: apiargs-common-param.yaml
9+
ref: $databaseName
10+
operation: MongoDB\\GridFS\\Bucket::__construct
11+
position: 2
12+
---
13+
source:
14+
file: apiargs-common-param.yaml
15+
ref: $options
16+
operation: MongoDB\\GridFS\\Bucket::__construct
17+
position: 3
18+
...
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
arg_name: param
2+
name: $id
3+
type: mixed
4+
description: |
5+
The ``_id`` of the file to delete.
6+
interface: phpmethod
7+
operation: MongoDB\\GridFS\\Bucket::delete
8+
optional: false
9+
position: 1
10+
...
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
arg_name: param
2+
name: $id
3+
type: mixed
4+
description: |
5+
The ``_id`` of the file to download.
6+
interface: phpmethod
7+
operation: MongoDB\\GridFS\\Bucket::downloadToStream
8+
optional: false
9+
position: 1
10+
---
11+
arg_name: param
12+
name: $destination
13+
type: resource
14+
description: |
15+
Writable stream where the GridFS file's contents will be written.
16+
interface: phpmethod
17+
operation: MongoDB\\GridFS\\Bucket::downloadToStream
18+
optional: false
19+
position: 2
20+
...
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
arg_name: option
2+
name: revision
3+
type: integer
4+
description: |
5+
The revision of the file to retrieve. Files with the name ``filename`` will be
6+
differentiated by their ``uploadDate`` field.
7+
8+
Revision numbers are defined as follows:
9+
10+
- 0 = the original stored file
11+
- 1 = the first revision
12+
- 2 = the second revision
13+
- etc...
14+
- -2 = the second most recent revision
15+
- -1 = the most recent revision
16+
17+
Defaults to -1 (i.e. the most recent revision).
18+
interface: phpmethod
19+
operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName
20+
optional: true
21+
position: 1
22+
...
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
arg_name: param
2+
name: $filename
3+
type: string
4+
description: |
5+
The ``filename`` of the file to download.
6+
interface: phpmethod
7+
operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName
8+
optional: false
9+
position: 1
10+
---
11+
arg_name: param
12+
name: $destination
13+
type: resource
14+
description: |
15+
Writable stream where the GridFS file's contents will be written.
16+
interface: phpmethod
17+
operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName
18+
optional: false
19+
position: 2
20+
---
21+
source:
22+
file: apiargs-common-param.yaml
23+
ref: $options
24+
operation: MongoDB\\GridFS\\Bucket::downloadToStreamByName
25+
position: 3
26+
...
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
arg_name: param
2+
name: $stream
3+
type: resource
4+
description: |
5+
The GridFS stream resource.
6+
interface: phpmethod
7+
operation: MongoDB\\GridFS\\Bucket::getFileDocumentForStream
8+
optional: false
9+
position: 1
10+
...
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
arg_name: param
2+
name: $stream
3+
type: resource
4+
description: |
5+
The GridFS stream resource.
6+
interface: phpmethod
7+
operation: MongoDB\\GridFS\\Bucket::getFileIdForStream
8+
optional: false
9+
position: 1
10+
...
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
arg_name: param
2+
name: $id
3+
type: mixed
4+
description: |
5+
The ``_id`` of the file to download.
6+
interface: phpmethod
7+
operation: MongoDB\\GridFS\\Bucket::openDownloadStream
8+
optional: false
9+
position: 1
10+
...
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
arg_name: option
2+
name: revision
3+
type: integer
4+
description: |
5+
The revision of the file to retrieve. Files with the name ``filename`` will be
6+
differentiated by their ``uploadDate`` field.
7+
8+
Revision numbers are defined as follows:
9+
10+
- 0 = the original stored file
11+
- 1 = the first revision
12+
- 2 = the second revision
13+
- etc...
14+
- -2 = the second most recent revision
15+
- -1 = the most recent revision
16+
17+
Defaults to -1 (i.e. the most recent revision).
18+
interface: phpmethod
19+
operation: MongoDB\\GridFS\\Bucket::openDownloadStreamByName
20+
optional: true
21+
position: 1
22+
...
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
arg_name: param
2+
name: $filename
3+
type: string
4+
description: |
5+
The ``filename`` of the file to download.
6+
interface: phpmethod
7+
operation: MongoDB\\GridFS\\Bucket::openDownloadStreamByName
8+
optional: false
9+
position: 1
10+
---
11+
source:
12+
file: apiargs-common-param.yaml
13+
ref: $options
14+
operation: MongoDB\\GridFS\\Bucket::openDownloadStreamByName
15+
position: 2
16+
...
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
arg_name: option
2+
name: _id
3+
type: mixed
4+
description: |
5+
Value to use as the file document identifier. Defaults to a new
6+
:php:`MongoDB\\BSON\\ObjectID <class.mongodb-bson-objectid>` object.
7+
interface: phpmethod
8+
operation: MongoDB\\GridFS\\Bucket::openUploadStream
9+
optional: true
10+
position: 1
11+
---
12+
arg_name: option
13+
name: chunkSizeBytes
14+
type: integer
15+
description: |
16+
The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option.
17+
interface: phpmethod
18+
operation: MongoDB\\GridFS\\Bucket::openUploadStream
19+
optional: true
20+
position: 2
21+
---
22+
arg_name: option
23+
name: metadata
24+
type: array|object
25+
description: |
26+
User data for the ``metadata`` field of the file document. If not specified,
27+
the ``metadata`` field will not be set on the file document.
28+
interface: phpmethod
29+
operation: MongoDB\\GridFS\\Bucket::openUploadStream
30+
optional: true
31+
position: 3
32+
...
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
arg_name: param
2+
name: $filename
3+
type: string
4+
description: |
5+
The ``filename`` of the file to create.
6+
interface: phpmethod
7+
operation: MongoDB\\GridFS\\Bucket::openUploadStream
8+
optional: false
9+
position: 1
10+
---
11+
source:
12+
file: apiargs-common-param.yaml
13+
ref: $options
14+
operation: MongoDB\\GridFS\\Bucket::openUploadStream
15+
position: 2
16+
...
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
arg_name: param
2+
name: $id
3+
type: mixed
4+
description: |
5+
The ``_id`` of the file to rename.
6+
interface: phpmethod
7+
operation: MongoDB\\GridFS\\Bucket::rename
8+
optional: false
9+
position: 1
10+
---
11+
arg_name: param
12+
name: $newFilename
13+
type: string
14+
description: |
15+
The new ``filename`` value.
16+
interface: phpmethod
17+
operation: MongoDB\\GridFS\\Bucket::rename
18+
optional: false
19+
position: 2
20+
...
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
arg_name: option
2+
name: _id
3+
type: mixed
4+
description: |
5+
Value to use as the file document identifier. Defaults to a new
6+
:php:`MongoDB\\BSON\\ObjectID <class.mongodb-bson-objectid>` object.
7+
interface: phpmethod
8+
operation: MongoDB\\GridFS\\Bucket::uploadFromStream
9+
optional: true
10+
position: 1
11+
---
12+
arg_name: option
13+
name: chunkSizeBytes
14+
type: integer
15+
description: |
16+
The chunk size in bytes. Defaults to the bucket's ``chunkSizeBytes`` option.
17+
interface: phpmethod
18+
operation: MongoDB\\GridFS\\Bucket::uploadFromStream
19+
optional: true
20+
position: 2
21+
---
22+
arg_name: option
23+
name: metadata
24+
type: array|object
25+
description: |
26+
User data for the ``metadata`` field of the file document. If not specified,
27+
the ``metadata`` field will not be set on the file document.
28+
interface: phpmethod
29+
operation: MongoDB\\GridFS\\Bucket::uploadFromStream
30+
optional: true
31+
position: 3
32+
...

0 commit comments

Comments
 (0)