Doc #74630 [Opn->Ver]: Syntax error in example

From: Date: Mon, 22 May 2017 16:27:18 +0000
Subject: Doc #74630 [Opn->Ver]: Syntax error in example
References: 1  Groups: php.doc.bugs 
Request: Send a blank email to doc-bugs+get-14714@lists.php.net to get a copy of this message
Edit report at https://bugs.php.net/bug.php?id=74630&edit=1 ID: 74630 Updated by: cmb@php.net Reported by: ionut dot mihaescu at gmail dot com Summary: Syntax error in example -Status: Open +Status: Verified Type: Documentation Problem -Package: Documentation problem +Package: mongodb Operating System: Ubuntu 16.04 x64 PHP Version: 7.0.19 -Assigned To: +Assigned To: cmb Block user comment: N Private report: N Previous Comments: ------------------------------------------------------------------------ [2017-05-22 12:06:16] ionut dot mihaescu at gmail dot com I miss typed : ... should and in a bracket "]" not in ")". Should be: ... should end in a bracket "]" not in ")". ------------------------------------------------------------------------ [2017-05-22 12:04:51] ionut dot mihaescu at gmail dot com Description: ------------ --- From manual page: http://www.php.net/mongodb-driver-query.construct --- The $options array should and in a bracket "]" not in ")". The example code will fail. $options = [ /* Only return the following fields in the matching documents */ 'projection' => [ 'title' => 1, 'article' => 1, ], /* Return the documents in descending order of views */ 'sort' => [ 'views' => -1 ], ); Expected result: ---------------- $options = [ /* Only return the following fields in the matching documents */ 'projection' => [ 'title' => 1, 'article' => 1, ], /* Return the documents in descending order of views */ 'sort' => [ 'views' => -1 ], ]; ------------------------------------------------------------------------ -- Edit this bug report at https://bugs.php.net/bug.php?id=74630&edit=1

« previous php.doc.bugs (#14714) next »