In brief
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?
Similar need for postgres can be archieved here
In full
Let's take below sample 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)
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.
My google search and search on our site result little helpful so I asked here.