For example, if I have a document like this
{
a: 1,
subdoc: {
b: 2,
c: 3
}
}
How can I convert it into a format like this? (without using project
)
{
a: 1,
b: 2,
c: 3
}
question from:https://stackoverflow.com/questions/22903849/how-to-flatten-a-subdocument-into-root-level-in-mongodb