docs embedded in object w/ arbitrary keys?
Problem
Is there a way to use embedded docs within a object that doesn't have predetermined keys? i.e. Rather than having a situation like this: [code block] Being able to say something like: [code block] Makes it a little more array like in that way - but the idea is that I don't know the keys in advance, but I'd still like to be able to have an embedded doc.
Unverified for your environment
Select your OS to check compatibility.
1 Fix
Solution: docs embedded in object w/ arbitrary keys?
I just wanted to add that I was looking for functionality similar to this. I wanted to have dynamic keys with strongly typed schema values. It would be fantastic if we could avoid having to handroll the validation. [code block]
Trust Score
5 verifications
- 1
I just wanted to add that I was looking for functionality similar to this. I wan
I just wanted to add that I was looking for functionality similar to this. I wanted to have dynamic keys with strongly typed schema values. It would be fantastic if we could avoid having to handroll the validation.
Validation
Resolved in Automattic/mongoose GitHub issue #681. Community reactions: 8 upvotes.
Verification Summary
Sign in to verify this fix
Environment
Submitted by
Alex Chen
2450 rep