Hello everybody.
We want to do a search using ming and from the results obtain the documents in dictionary format in order to manipulate it or save it in csv.
We honestly have not found about this in the documentation and ming only returns an object in the search.
Therefore, we have looked at the code and we propose the following to obtain the dictionary but we do not know if it is the most optimal or correct.
We have the following ming object
In [8]: full = BaseGobcanApp.query.find().all()
In [9]: full[0]
Out[9]:
<BaseGobcanApp _id=ObjectId('60dc561b8eb792f353c19e24')
_version=1 app_id=524 full_name='PRIVADO' area_id=12
servicio='Aplicaciones Corporativas' servicio_id=4
updated=datetime.datetime(2021, 6, 30, 13, 11, 52, 961000)
from_full_scrap=True>
And with this command we get its dictionary
In [24]: full[0].__ming__.state.document
Out[24]:
{'_id': ObjectId('60dc561b8eb792f353c19e24'),
'_version': 1,
'app_id': 524,
'area': 'ADMINISTRACIONESPUBLICAS',
'area_id': 12,
'from_full_scrap': True,
'full_name': 'PRIVADO',
'servicio': 'Aplicaciones Corporativas',
'servicio_id': 4,
'updated': datetime.datetime(2021, 6, 30, 13, 11, 52, 961000)}
Questions: