There is currently no way to do this.
MongoDB is “no schema”, but should not be confused with “no schema”. It implies the assumption that your code has some control over the key names that actually appear on the system.
Let me ask you a question around.
- Is there a good reason users enter case-sensitive keys?
- Can you just overwrite all the keys in lower case when they are inserted?
Again, MongoDB assumes that you have some information about the available keys. Your question implies that you do not know the keys available. You need to close this gap.
source share