MLab Object ID retrieval error

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP



MLab Object ID retrieval error



I'm using Mlab to host my mongoDB database. I've been having trouble to obtain the object ID from the Mlab collections. I'm using a flask extension called Flask-MongoAlchemy for this. I've been trying to obtain the object ID in this way but in vain.
Here's the code I've used for this:


employee = Employee.query.filter_by(email=request.form['email']).first()
session['employee_id'] = employee.get_or_404(id)



Here's the schema:



"_id":
"$oid": "5b6735ac911cb113afede8ad"
,
"email": "saicharan.reddy1@gmail.com",
"password": "$2b$10$iqj0re6ssg2Y9MxZPuJFcOP/rh7zX6umcS5jG7XHLFeD7V8rpMn.S",
"first_name": "Saicharan",
"last_name": "Reddy"









By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Popular posts from this blog

Firebase Auth - with Email and Password - Check user already registered

Dynamically update html content plain JS

Creating a leaderboard in HTML/JS