title: Run a command in mongodb container with credentials from outside
body: <p>I want to set the compatibility version in mongodb, which is running in a container, but from outside:</p>
  <pre><code>docker exec -it docker-compose_mongodb_1 bash -c 'mongo -uroot -p rootpassword --eval &quot;db.adminCommand( { setFeatureCompatibilityVersion: &quot;4.0&quot; } )&quot;'
  
  
  
  MongoDB shell version v4.0.23
  connecting to: mongodb://127.0.0.1:27017/?gssapiServiceName=mongodb
  Implicit session: session { &quot;id&quot; : UUID(&quot;7945d913-f77c-4242-be33-af8e20c07374&quot;) }
  MongoDB server version: 4.0.23
  {
          &quot;ok&quot; : 0,
          &quot;errmsg&quot; : &quot;Command argument must be of type String, but was of type double in: { setFeatureCompatibilityVersion: 4.0, lsid: { id: UUID(\&quot;7945d913-f77c-4242-be33-af8e20c07374\&quot;) }, $db: \&quot;admin\&quot; }. See http://dochub.mongodb.org/core/4.0-feature-compatibility.&quot;,
          &quot;code&quot; : 14,
          &quot;codeName&quot; : &quot;TypeMismatch&quot;
  }
  </code></pre>
  <p>Any idea what I am doing wrong?</p>