-
Notifications
You must be signed in to change notification settings - Fork 266
PHPLIB-1322: Document codec option for classes and operations #1264
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
Conversation
@ccho-mongodb: Please add yourself as a reviewer. |
@jmikola I requested permissions to add myself as a reviewer. I created a staging build with Snooty and there are several build errors that seem to be causing some of the content to be omitted. Missing content example - codec description is blank If you didn't see these errors when building with giza and the issue doesn't seem clear based on the log, please reach out to the Docs Platform team to get more info. |
ebae0cf
to
37e313b
Compare
@@ -1,3 +1,11 @@ | |||
ref: bucket-option-codec | |||
content: | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@ccho-mongodb: I removed use of post
here and for collection-option-codec
. There is still an existing use of it in collection-option-collation
, but I'll fix that in a separate PR against v1.16 and attribute it to DOCSP-37027.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM! Added a couple questions and suggestions, but nothing blocking.
Latest:
The bucket-option-codec and collection-option-codec do not inherit common-option-codec since Snooty does not yet support "post" for appending to inherited content.
bbf1b52
to
3bec6dd
Compare
The :doc:`codec </tutorial/codecs>` to use for encoding or decoding documents. | ||
This option is mutually exclusive with the ``typeMap`` option. | ||
|
||
Defaults to the bucket's codec. Inheritance for a default ``codec`` option |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means if both the codec and the typeMap options are set in the bucket, we take the bucket. And if the codec is set to null in this method call, we use the typeMap from the Bucket?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This means if both the codec and the typeMap options are set in the bucket, we take the
bucketcodec.
Corrected what I assume is a typo.
And if the codec is set to null in this method call, we use the typeMap from the Bucket?
That is correct.
The PHPLIB docs have never discussed passing null
for options. null
values are typically ignored when we process options in Operation classes due to the use of isset()
.
If the codec
option is null
, the Bucket::find()
and findOne()
methods will still send it along to the CollectionWrapper since they use array_key_exists()
; however, when it is ultimately received by the files collection's Collection::find()
or findOne()
method, the null
value will be ignored based on the logic in Collection::inheritCodecOrTypeMap()
.
https://jira.mongodb.org/browse/PHPLIB-1322