I’m using print to debug my map/reduce queries though when I partition my database to shards the output from print is redirected to the shard where the data is stored. So how would you redirect the output from mongod instances to mongos instance?
I’m using print to debug my map/reduce queries though when I partition my database
Share
Unfortunately there’s no good way to do this. When you do a print statement in server-side javascript such as a map-reduce, the print will show up on whichever server the javascipt code is executing. When running on a non-sharded collection, this will be whichever shard is the primary shard for the database. On a sharded collection, this could be on any shard, depending on where the code is running when it hits the print statement.