I want to combine three keys in my documents to an array using mongodb aggregate. Here is an example of what I am trying to accomplish:
Input Document:
{
_id: "xyz",
p1: "A",
p2: "E",
p3: "C"
}
Output Document:
{
_id: "xyz",
p: ["A", "E", "C"]
}
Does anyone have an idea how to accomplish this using mongodb aggregate?
Cheers J