[CXX-934] Remove database::stats() Created: 17/Jun/16  Updated: 19/Sep/16  Resolved: 24/Jun/16

Status: Closed
Project: C++ Driver
Component/s: None
Affects Version/s: None
Fix Version/s: 3.0.2

Type: Bug Priority: Major - P3
Reporter: Rustam Abdullaev Assignee: Backlog - CXX Driver Team
Resolution: Done Votes: 1
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified

Issue Links:
Duplicate
is duplicated by CXX-944 mongocxx::database::stats() causes er... Closed

 Description   

It looks like the driver is missing implementation for database::stats().

I see only its declaration in the class database.

Please implement (or point me to the implementation if I missed it).



 Comments   
Comment by Andrew Morrow (Inactive) [ 24/Jun/16 ]

Fixed by removing the declaration. We don't want to provide an implementation of this helper.

Comment by Githook User [ 24/Jun/16 ]

Author:

{u'username': u'acmorrow', u'name': u'Andrew Morrow', u'email': u'acm@mongodb.com'}

Message: CXX-934 Remove the unwanted and unimplemented database::stats helper declaration
Branch: master
https://github.com/mongodb/mongo-cxx-driver/commit/8131c1689bd5d843dc628eb591ff51cb6baad312

Comment by Andrew Morrow (Inactive) [ 24/Jun/16 ]

https://github.com/mongodb/mongo-cxx-driver/pull/503

Comment by Rustam Abdullaev [ 23/Jun/16 ]

Yes that's what we're using - run_command(document{} << "dbStats" << 1 << finalize);

So option b sounds good.

Comment by Andrew Morrow (Inactive) [ 23/Jun/16 ]

Please note that modern design practices for MongoDB drivers suggests not implementing helpers like database::stats. Doing so in the past has lead to drivers with a proliferation of helpers that become obsolete as the server evolves, leading to maintenance headaches for the driver. Since this ticket can be resolved by either a) providing an implementing definition for database::stats or b) simply removing the declaration which never worked, we are leaning towards simply removing the declaration in light of the above view on helpers. The workaround is simply to invoke database::run_command directly.

Comment by Andrew Morrow (Inactive) [ 17/Jun/16 ]

Thanks rustyx - Definitely looks like that was missed. We will get it fixed.

Generated at Wed Feb 07 22:00:50 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.