I have website configuration (currently stored as JSON file), and I would like to move it to MongoDB and probably use Mongoose to handle read-write operations and perform validation through schemas.
Configuration is an object with limited amount of keys, similar to that:
{
siteOffline: false,
storeOffline: false,
priceMultipliers: {
a1: 0.96
a2: 0.85
},
...
}
Should it be made a collection with key-value entries? Not sure how to enforce Mongoose schema in this case.
Should it be made a collection with a single document? Not sure how to guarantee that there is only one document at a time.
Any other options?