title: pymongo to extract query in pyython to mongod's javascript query syntax
body: <h2>In brief</h2>
  
  <p>We have query written in Python via pymongo package as below sample and we want to run the same query via mongo cli in console. How can we do that ie. to get the javascript syntax of that query?</p>
  
  <p>Similar need for postgres can be archieved <a href="https://stackoverflow.com/q/4617291/248616">here</a></p>
  
  <h2>In full</h2>
  
  <p>Let's take below sample code</p>
  
  <pre><code>from pymongo import MongoClient
  client  = MongoClient('mongodb://YOUR_HOST:27017/', connect=False)
  mongodb = client['YOUR_DB']
  docs = mongodb['YOUR_COLLECTION'].aggregate([
      {'$match':{
          'someField': 'someFilter',
      }},
  ], allowDiskUse=True)
  </code></pre>
  
  <p>I want to run that query, ie. the javascript syntax version, via mongo cli in console e.g. on another server that has full documents/rows.</p>
  
  <p>My <a href="https://www.google.com.vn/search?q=pymongo%20extract%20mongod%20javascript%20query%20syntax&amp;oq=pymongo%20extract%20mongod%20javascript%20query%20syntax&amp;aqs=chrome..69i57.17770j0j7&amp;sourceid=chrome&amp;ie=UTF-8" rel="nofollow noreferrer">google search</a> and <a href="https://stackoverflow.com/search?q=pymongo%20extract%20mongod%20javascript%20query%20syntax#">search on our site</a> result little helpful so I asked here.</p>