Recently i notice that a parameter fromRouter" : true exists on mongoDB aggregations. I search the MongoDB documentation and google for it, but i didn't found anything about it. Can anyone explain what this parameter is, or share any useful resource for it?

"op" : "command",
"ns" : "database_name.$cmd",
"command" : {
    "aggregate" : "collection",
    "pipeline" : [...erase them to make the post smaller...],
    "fromRouter" : true,
    "$queryOptions" : {
        "$readPreference" : {
            "mode" : "primary"
"ntoreturn" : 1,
"keyUpdates" : 0,
"numYield" : 440,
"lockStats" : {
    "timeLockedMicros" : {
        "r" : NumberLong(3106252),
        "w" : NumberLong(0)
    "timeAcquiringMicros" : {
        "r" : NumberLong(5302577),
        "w" : NumberLong(6145)

1 Answer 1


It just means that this is a sharded cluster and the aggregation is happening via a mongos (also known as a query router). This is important for aggregations internally because it means that the output from multiple shards may need to be merged but it's not really relevant for most end users (you usually already know you are running in a sharded environment).

  • Thanks i mark this as correct, i hope i find the time to test it.
    – Antonios
    Commented Feb 10, 2015 at 21:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.