I'm not sure if this is the best way, but I'm creating a blogging system in node.js where I have my schema for blogPost and I have another schema for authors.
Now I want to create another one, but this one would only use to store configuration of the blog only.
Such as: how many blog post to display, what is the layout to use to display the page, who is the admin of the blog and so on.
I'm not sure if that is possible, but the reason why I want only to have one record is because if the key already exist in the database next time they open up that page it will only be updating the value if they want to change something.
I'm using Mongoose and Elasticsearch to index and mirror the database using mongoosastic.
Yes, this is possible without anything special really other than only put 1 document into that collection. I would just leave your default set of configuration settings as a simple javascript object in code and if you find a configuration record in mongo, just use that to override the defaults via _.defaults or similar. For what it's worth, more commonly identifying the blog admin would be stored on the user record, not in a blog configuration object (user.isAdmin = true for a simple case), but either way will work.