Q:

"Checkbox"/option type MongoDB schema design

I am looking to implement some type of checkbox functionality for settings on an account, e.g.
option:
    value1: true
    value2: false
    value 3: false

My first thought was to have an array key named option and then have an array of Strings from an enum, like so:
key: { type: [String], required: true, enum: [
    'value1', 'value2'
 ]}

and then I can check to see what options the users has in the array vs. the possible enum values...
But maybe I should do something like this;
key: {
    value1: { type: Boolean, required: true, default: true },
    value2: { type: Boolean, required: true, default: true }
}

I want this to be super customizable and flexible going forward, so I was wondering if anyone had any suggestions?

A:

The second option is better. Much more easy to perform queries.

