docstr: converts call to string
  
  {
      'collection': 'fish',
      'call': [   // call is sequence of methods
          {
              'method': 'find',
              'args': [{a:1}, {b:2}]
          },
          {
              'method': 'sort',
              'args': [{c:3}]
          },
      ]
  }
  
  to:
  
   "db_test.fish.find({a:1}, {b:2}).sort({c:3})"
docstr_tok: ["converts","call","to","string","{","'collection","'",":","'fish","'",",","'call","'",":","[","\/\/","call","is","sequence","of","methods","{","'method","'",":","'find","'",",","'args","'",":","[","{","a:1","}",",","{","b:2","}","]","}",",","{","'method","'",":","'sort","'",",","'args","'",":","[","{","c:3","}","]","}",",","]","}","to",":","``","db_test.fish.find","(","{","a:1","}",",","{","b:2","}",")",".sort","(","{","c:3","}",")","''"]
code: def __str__(self):
      """
      converts call to string
  
      {
          'collection': 'fish',
          'call': [   // call is sequence of methods
              {
                  'method': 'find',
                  'args': [{a:1}, {b:2}]
              },
              {
                  'method': 'sort',
                  'args': [{c:3}]
              },
          ]
      }
  
      to:
  
       "db_test.fish.find({a:1}, {b:2}).sort({c:3})"
      """
  
      call_str = f"db.{self.collection}"
      for step in self.pipeline:
          args_str = []
          for arg in step["args"]:
              args_str.append(MongoJSONEncoder().encode(arg))
          call_str += f'.{step["method"]}({",".join(args_str)})'
      return call_str
  
file_path: mindsdb/mindsdb/api/mongo/utilities/mongodb_query.py
imports: import datetime
  from json import JSONEncoder
  from bson import ObjectId
label_desc: Use image node_id 5 for calling the MongoQuery obj's underlying member method code with example usage: obj.__str__() and returns: call_str