I am getting the below error on a select query with MongoDb in Django.
SELECT COUNT(*) FROM (SELECT DISTINCT "datacollection_computed_host_details"."id" AS Col1, "datacollection_computed_host_details"."HOST" AS Col2, "datacollection_computed_host_details"."TYP" AS Col3, "datacollection_computed_host_details"."isBM" AS Col4, "datacollection_computed_host_details"."Kernal" AS Col5, "datacollection_computed_host_details"."os_version" AS Col6, "datacollection_computed_host_details"."SID" AS Col7, "datacollection_computed_host_details"."DBSID" AS Col8, "datacollection_computed_host_details"."IS_VLAB" AS Col9, "datacollection_computed_host_details"."ZHCODE" AS Col10, "datacollection_computed_host_details"."DC" AS Col11, "datacollection_computed_host_details"."SYSTEMROLE" AS Col12, "datacollection_computed_host_details"."MEMORY" AS Col13, "datacollection_computed_host_details"."EUDP" AS Col14 FROM "datacollection_computed_host_details" WHERE ("datacollection_computed_host_details"."IS_VLAB" = %(0)s AND "datacollection_computed_host_details"."SID" iLIKE %(1)s)) subquery
ERROR :
djongo.sql2mongo.SQLDecodeError:
Version: 1.2.33
Django Version 2.1.8
Python 3.7.2
Background :
I am working on a Django project that uses rest_framework_datatables for Datatable integration. I am able to receive the data in frontend and able to sort the data. But when I apply the search I am getting 500 in the Django side. It will be really great if you help me to solve this problem. I am stuck for more than a week .
I think its a MongoDB error : I saw reply in https://github.com/nesdis/djongo/issues/156
Since i am new to django and MongoDB i am unable to perform your solution.
MongoDB error :
djongo.sql2mongo.SQLDecodeError: FAILED SQL: SELECT COUNT(*) FROM (SELECT DISTINCT "datacollection_computed_host_details"."id" AS Col1, "datacollection_computed_host_details"."HOST" AS Col2, "datacollection_computed_host_details"."TYP" AS Col3, "datacollection_computed_host_details"."isBM" AS Col4, "datacollection_computed_host_details"."Kernal" AS Col5, "datacollection_computed_host_details"."os_version" AS Col6, "datacollection_computed_host_details"."SID" AS Col7, "datacollection_computed_host_details"."DBSID" AS Col8, "datacollection_computed_host_details"."IS_VLAB" AS Col9, "datacollection_computed_host_details"."ZHCODE" AS Col10, "datacollection_computed_host_details"."DC" AS Col11, "datacollection_computed_host_details"."SYSTEMROLE" AS Col12, "datacollection_computed_host_details"."MEMORY" AS Col13, "datacollection_computed_host_details"."EUDP" AS Col14 FROM "datacollection_computed_host_details" WHERE ("datacollection_computed_host_details"."IS_VLAB" = %(0)s AND "datacollection_computed_host_details"."SID" iLIKE %(1)s)) subquery
Params: (False, '%E39%')
Thanks in advance
Thanks & Regards, Mohamed Naveen