node.js - Best practice to store a operation hours in mongo -
i need design schema in mongoose store operation hour shop, ui in admincp this:
as can see first column working day, owner of shop can turn on/off if want. second opening hour , last 1 closing hour.
the schema need have default value "off" or "false" sat , sun every shops close on these days.
i not sure how design schema in mongoose.
this come up:
working: { mon: { enable: { type: boolean, default: true }, start: { type: number }, end: { type: number } }, tue: /* , on */ }
it looks bad, there must better way it.
Comments
Post a Comment