Reputation: 1530
I am managing an HR database that consists of two collections: ‘employees’ and ‘attendances.’ To optimize performance, I have structured the ‘attendances’ collection by grouping attendance objects based on the employee _id. The challenge now lies in defining the schema for the following data:
attendances Collection :
[
{
_id: 65e192de07cd275142fc7ef6
{
"65e190a435710d49fb9adcae":{
"2024-01-01":{
"clocks": {
"08:30" : {"by": "gate1", "at": "2024-01-01T08:30" }
},
"TWH":"08:45"
}
},
"65e190a444710d49fb9adcae":{
"2024-01-01":{
"clocks": {
"08:35" : {"by": "user", "at": "2024-01-01T12:30" }
},
"TWH":"08:15"
}
}
}
}
]
more, I want use GraphQL, not sure using redWoodJS or direct from mongoDB, or both, but will appling query like bring either all employee or specific employees' attendance by emp id, more, only TWH not other details like TWH.
Upvotes: 0
Views: 21