I am new to mongodb and writing a demo code in python using pymongo client for connection between mongodb and python.
I have created two collections with Database named "Mongodb_demo":
1. Employee (employeename, sal, employeeid, depid)
2. Department (depid, deptname, dept_description)
I need to find the "In which department, employees are highest in number".
I have tried many documentations, but only mongodb environment code is available. How do I integrate the mongodb query with python code or how do i change the syntax to get the result in python list format.
Demo data provide below:
**Collection = department**
{'depid': 1.0, 'deptname': 'Marketing', 'dept_description': 'This is Marketing department.'}
{'depid': 2.0, 'deptname': 'HR', 'dept_description': 'This is Human Resource department.'}
{'depid': 3.0, 'deptname': 'Operations', 'dept_description': 'This is Operations department.'}
**Collection = employee**
{'employeename': 'Rohan Patil', 'sal': 50000.0, 'employeeid': 'rohan.patil.512', 'depid': 2.0}
{'employeename': 'Goldy Sharma', 'sal': 40000.0, 'employeeid': 'goldy.sharma.513', 'depid': 2.0}
{'employeename': 'Venugopal Ayeer', 'sal': 45000.0, 'employeeid': 'venugopal.ayeer.511', 'depid': 2.0}
{'employeename': 'Sudha Murti', 'sal': 45000.0, 'employeeid': 'sudha.murti.514', 'depid': 3.0}
{'employeename': 'Rajesh Kumar', 'sal': 38000.0, 'employeeid': 'rajesh.kumar.515', 'depid': 1.0}