I am new to NoSQL databases and MongoDb. I've got the following question:
I have a collection of such documents:
{
vals: [
{
value: 111,
timestamp: 1563454669669
},
{
value: 222,
timestamp: 1563454689665
},
{
value: 333,
timestamp: 1563454669658
}
.......
]
}
I would like to convert it into the following documents using aggregation pipeline:
{
vals: [
[
111,
1563454669669
],
[
222,
1563454689665
],
[
333,
1563454669658
]
.......
]
}
After years of work with relational databases, it's quite hard to understand..