-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Minor - P4
-
None
-
Affects Version/s: None
-
Component/s: Builder
-
None
-
None
-
PHP Drivers
-
None
-
None
-
None
-
None
-
None
-
None
The MQL specifications support a default field on arguments to document server-side default values. Currently, the PHP code generator ignores this field entirely — the only exception is $function, where args and lang have defaults that are always serialized.
The goal is to use default more broadly in the spec (e.g. exact: false in vectorSearch), with the following rule for the PHP generator:
- If optional: true → document the default in the spec but do not include it in PHP method signatures or serialized output (PHP does not send default values to the server)
- If optional: false (required argument with a default, like $function.lang) → always serialize the default value
Tasks:
- Update the spec to add default values on optional arguments where applicable (starting with vectorSearch.exact)
- Update the PHP code generator to respect this rule
Reference: https://github.com/mongodb/mql-specifications/pull/45#discussion_r3309792110