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, 2020 in Python by anonymous
• 160 points

recategorized Oct 13, 2020 by Niroj 1,133 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, 2020 by Gitika
• 65,870 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, 2020 in Python by Tarık
• 120 points
491 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, 2020 in Python by Niroj
• 82,680 points
120 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, 2020 in Python by Niroj
• 82,680 points
1,086 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, 2020 in Python by Niroj
• 82,680 points
2,883 views
0 votes
1 answer
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, 2020 in Python by Gitika
• 65,870 points
1,759 views