Object of type ObjectId is not JSON serializable, how to send mongo object as json while return?

0 votes

def get_all_notification(request):

    list_of_notification = DatalayersClass.get_all_notification_data()

    # data.append({'params':list_of_params })

    return json.dumps(list_of_notification)

Oct 13 in Python by anonymous
• 160 points

recategorized Oct 13 by Niroj 92 views

1 answer to this question.

0 votes
Hi, @There,

Make sure that your MongoDB instance is running on Windows, run the following command from the Windows command prompt:

tasklist /FI "imagename eq mongod.exe"
answered Oct 13 by Gitika
• 49,540 points

Related Questions In Python

0 votes
0 answers

Excel .json Import Error: The Type of Current Preview Value is Too Complex to Display

Main Problem: I'm trying to import .json to excel ...READ MORE

Mar 14 in Python by Tarık
• 120 points
406 views
0 votes
1 answer

How to return None if Dictionary key is not available?

Hello @kartik, You should use the get() method from the dict class d ...READ MORE

answered Apr 13 in Python by Niroj
• 77,920 points
81 views
0 votes
1 answer

How to convert a DictProxy object into JSON serializable dict?

Hello, Rather than using a private DictProxy method like _getvalue(), I'd ...READ MORE

answered Apr 15 in Python by Niroj
• 77,920 points
644 views
0 votes
1 answer

How to return None if Dictionary key is not available

Hello @kartik, You can use dict.get() value = d.get(key) which will ...READ MORE

answered Apr 30 in Python by Niroj
• 77,920 points
1,225 views
0 votes
1 answer

How to check the memory usage of an object in python

Hi, @Roshni, You can use this code below: import ...READ MORE

answered Jun 26 in Python by Gitika
• 49,540 points
601 views