[DOCS-11104] Comment on: "manual/reference/command/listDatabases" Created: 08/Dec/17  Updated: 27/Oct/23  Resolved: 09/Apr/18

Status: Closed
Project: Documentation
Component/s: None
Affects Version/s: None
Fix Version/s: None

Type: Bug
Reporter: Docs Collector User (Inactive) Assignee: Stennie Steneker (Inactive)
Resolution: Works as Designed Votes: 0
Labels: collector-298ba4e7, mts
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Issue Links:
Related
is related to SERVER-3181 Add option to listDatabases to only g... Closed
Participants:
Days since reply: 5 years, 44 weeks, 2 days ago

 Description   

how can i list the database name only i'm using this code
$client = new MongoDB\Client;
$parn = $client->listDatabases();

foreach ($parn as $databaseInfo)

{ var_dump($parn); }

please help me to solve this problem im not using mongodb 3.6



 Comments   
Comment by Stennie Steneker (Inactive) [ 09/Apr/18 ]

As per SERVER-3181, the nameOnly option for the listDatabases command was added in MongoDB 3.6 and backported to MongoDB 3.4.3 and 3.2.13. If you are running a prior release of MongoDB you will have to iterate the full command results to extract the database names.

Note that the DOCS project is for reporting documentation errata or suggestions. For appropriate channels for MongoDB-related support discussion please refer to Technical Support options in the MongoDB documentation.

Regards,
Stennie

Generated at Thu Feb 08 08:02:04 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.