Details
-
Bug
-
Resolution: Won't Fix
-
Blocker - P1
-
None
-
2.2.0
-
None
-
Linux CentOS/RHEL, Mac OSX
-
ALL
Description
We tag each query for profiling using _addSpecial and $comment:
db.test.find(
{field:"value"})._addSpecial("$comment", "[COMMENT]")
These show up correctly in the logs and db.currentOp() when using collection.find() method.
But any flags added via _addSpecial are not used by the collection's getCount() method. We use the count method to display a query's total count:
db.test.find(
{field:"value"}).count()
db.test.find(
)._addSpecial("$comment", "[COMMENT]").count()
The .count() disregards any special flags, so profiling/tracing/db.currentOp() do not show our unique tag for that query.
Based on the source code, the DBCollection.getCount() method does not accept any special flags parameters, so it looks like a core server issue.
See attached console session, where a .find()._addSpecial shows the $comment via db.currentOp(), but it is not displayed when I issue a .find()._addSpecial().count()
Attachments
Issue Links
- is documented by
-
DOCS-9028 _addSpecial() flags not used by DBCollection.getCount() method eg collection.find()._addSpecial().count()
-
- Closed
-