skip to Main Content

String aggregation in MongoDB

I have a collection of documents as follows: { "id": ..., "key": 47 }, { "id": ..., "key": 12 } I want to aggregate the whole collection to a single string, by concatenating the keys, delimited by |. So here,…

VIEW QUESTION

Mongodb – Mongo – aggregate docs containing contiguous time ranges into minimum document number

I have millions of docs containing start and end times of something they're measuring. [ { "start" : ISODate("2024-01-01T00:00:00"), "end" : ISODate("2024-01-01T01:00:00") }, { "start" : ISODate("2024-01-01T01:00:00"), "end" : ISODate("2024-01-01T02:00:00") }, { "start" : ISODate("2024-01-01T03:00:00"), "end" : ISODate("2024-01-01T04:00:00") }, ]…

VIEW QUESTION
Back To Top
Search