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:

working hour

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

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -