The below displays a "profile" object recorded in mongodb.
I know this type of schema is very possible on mongoDB where you would create an inner object called "name" and "alias" inside your profile object. I have done it myself and tested this already.
{"name": {"name": "Peter", "show": false},
"alias": {"alias":"GoofyDuck", "show": false}}
I feel that "name" and "alias" inner objects are not really necessary as I have an inner object called alias with a field called alias and would like my "profile" object to look like this instead -Is this even possible on mongoDB? Please show me with code if it is.
{{"name": "Peter", "show": false},
{"alias":"GoofyDuck", "show": false}}
I also know that this is possible but don't really want to embed it into an array:
{[{"name": "Peter", "show": false},
{"alias":"GoofyDuck", "show": false}]}