title: mongoexport with read preference containing tags
body: <p>I'm trying to export a collection from my MongoDB but I would like the export to be from a specific secondary server using tags in read preference. 
  My MongoDB consists of one replica set: primary-secondary-secondary.
  One secondary is tagged as <em>"tgg":"tgg1"</em> and the second one is tagged as <em>"tgg":"tgg2"</em>.</p>
  
  <p>This replica set is configured to be a single shard. With mongos client running on port localhost:47010.</p>
  
  <p>I'm using mongoexport 3.4</p>
  
  <p>The mongoexport command I'm running:</p>
  
  <p><code>mongoexport --port 47010 --db test --collection test_collection --out ~/tmp/mongo/test.json --readPreference '{"mode":"secondary", "tags":[{"tgg":"tgg2"}]}' --verbose</code></p>
  
  <p>I'm getting the following error:</p>
  
  <p><em><strong>Failed: Failed to call say, no good nodes in replset1</strong></em></p>
  
  <p>But, if I don't specify the tags but only that the mode is "secondary" everything is working.</p>
  
  <p>Am I missing something here?</p>
  
  <h2>EDIT</h2>
  
  <p>So I found what was wrong, I had to go to their source code in github for that but still. I must say that the error messaging is not sufficient.
  It seems I supplied a list of tags and not just a Json object.
  So the following command worked:</p>
  
  <p><code>mongoexport --port 47010 --db test --collection test_collection --out ~/tmp/mongo/test.json --readPreference '{mode:"secondary", tags:{"tgg":"tgg2"}}' --verbose</code></p>