code: def default_encode(v):
      
      if isinstance(v, ObjectId):
          return unicode_type(v)
  
      if isinstance(v, datetime):
          return format_time(v)
  
      if isinstance(v, date):
          return format_time(v)
  
      return v
docs: convert ObjectId, datetime, date into string