From a678daf64f4c44a1b822477edee14b6e8bae7e9e Mon Sep 17 00:00:00 2001 From: Jeremy Mikola Date: Tue, 7 Jun 2022 18:51:34 -0400 Subject: [PATCH] Document comment and let options for BulkWrite and Query https://jira.mongodb.org/browse/PHPC-2049 https://jira.mongodb.org/browse/PHPC-2005 --- language-snippets.ent | 14 +++++++++++ .../mongodb/driver/bulkwrite/construct.xml | 23 +++++++++++++++++++ .../mongodb/driver/query/construct.xml | 20 +++++++++++++--- 3 files changed, 54 insertions(+), 3 deletions(-) diff --git a/language-snippets.ent b/language-snippets.ent index 274e1c4c1d..6f20a51ad3 100644 --- a/language-snippets.ent +++ b/language-snippets.ent @@ -2681,6 +2681,20 @@ used.'> '> + + let + arrayobject + + + Map of parameter names and values. Values must be constant or closed expressions that do not reference document fields. Parameters can then be accessed as variables in an aggregate expression context (e.g. $$var). + + + This option is available in MongoDB 5.0+ and will result in an exception at execution time if specified for an older server version. + + + +'> keyVaultClient diff --git a/reference/mongodb/mongodb/driver/bulkwrite/construct.xml b/reference/mongodb/mongodb/driver/bulkwrite/construct.xml index a6b866382f..cdf93ee08d 100644 --- a/reference/mongodb/mongodb/driver/bulkwrite/construct.xml +++ b/reference/mongodb/mongodb/driver/bulkwrite/construct.xml @@ -55,6 +55,22 @@ &false; + + comment + mixed + + + An arbitrary comment to help trace the operation through the + database profiler, currentOp output, and logs. + + + This option is available in MongoDB 4.4+ and will result in an + exception at execution time if specified for an older server + version. + + + + &mongodb.option.let; ordered bool @@ -93,6 +109,13 @@ + + PECL mongodb 1.14.0 + + Added the "comment" and "let" + options. + + PECL mongodb 1.1.0 diff --git a/reference/mongodb/mongodb/driver/query/construct.xml b/reference/mongodb/mongodb/driver/query/construct.xml index 8b289c3d58..94edeec60c 100644 --- a/reference/mongodb/mongodb/driver/query/construct.xml +++ b/reference/mongodb/mongodb/driver/query/construct.xml @@ -96,11 +96,15 @@ &mongodb.option.collation; comment - string + mixed - A comment to attach to the query to help interpret and trace query - profile data. + An arbitrary comment to help trace the operation through the + database profiler, currentOp output, and logs. + + + The comment can be any valid BSON type for MongoDB 4.4+. Earlier + server versions only support string values. Falls back to the deprecated "$comment" modifier @@ -163,6 +167,7 @@ + &mongodb.option.let; limit int @@ -431,6 +436,15 @@ + + PECL mongodb 1.14.0 + + + Added the "let" option. The + "comment" option now accepts any type. + + + PECL mongodb 1.8.0