[CDRIVER-632] Add mongoc_client_get_default_database Created: 03/May/15  Updated: 17/Aug/15  Resolved: 03/Jun/15

Status: Closed
Project: C Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 1.2-beta0

Type: New Feature Priority: Minor - P4
Reporter: A. Jesse Jiryu Davis Assignee: A. Jesse Jiryu Davis
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Related
is related to PYTHON-461 API to create a database.Database ins... Closed
Backwards Compatibility: Fully Compatible

 Description   

Akin to PyMongo's MongoClient.get_default_database:

http://api.mongodb.org/python/current/api/pymongo/mongo_client.html?highlight=get_default_database#pymongo.mongo_client.MongoClient.get_default_database

Takes a client and returns a mongoc_database_t if the client was created with a database name in the URI, otherwise returns NULL.

Useful because you can change the database used for operations just by changing a configured URI, without code changes.



 Comments   
Comment by Githook User [ 03/Jun/15 ]

Author:

{u'username': u'ajdavis', u'name': u'A. Jesse Jiryu Davis', u'email': u'jesse@mongodb.com'}

Message: CDRIVER-632 add mongoc_client_get_default_database
Branch: 1.2.0-dev
https://github.com/mongodb/mongo-c-driver/commit/4a230c4a023014a35f5e93461ba36de12ce279cc

Generated at Wed Feb 07 21:10:07 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.