-
Notifications
You must be signed in to change notification settings - Fork 0
/
mongo_data.py
53 lines (41 loc) · 1.01 KB
/
mongo_data.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import pymongo
import datetime
client = pymongo.MongoClient("mongodb://localhost:27017")
db = client.hrms
emp = db.employee
admin = db.admin
emp.drop()
admin.drop()
employee_one = {
"name":"ashish",
"job_role":"director",
"date_of_birth":"24101996",
"blood_group":"b-negative",
"team":"administration",
"manager":"self",
"hr":"priyanka",
"joining_date":"01012024",
"org_email":"[email protected]",
"password":"theguy",
"personal_email":"[email protected]",
"created_at":str(datetime.datetime.now())
}
amdin_one = {
"name":"ashish",
"job_role":"director",
"date_of_birth":"24101996",
"team":"administration",
"manager":"self",
"hr":"priyanka",
"joining_date":"01012024",
"org_email":"[email protected]",
"password":"theguy",
"personal_email":"[email protected]",
"created_at": str(datetime.datetime.now()),
"approval_status":"completed",
"approved_by":"ashish",
"admin-category": "super-admin"
}
emp.insert_one(employee_one)
res = admin.insert_one(amdin_one)
print(res.acknowledged)