Getting most recent documents in time series collection

Hi @Benjamin_Behringer,

Regarding your approach in 1., I would perhaps avoid this scenario as this is an implementation detail and it might change in future MongoDB versions as the feature is improved.

To get a better idea of what you’re trying to achieve with the second approach, would you be able to provide the following information:

  1. MongoDB Version in use.
  2. Sample document(s).
  3. Expected output.
  4. “Yet, I don’t know how to dynamically increase the window in the aggregation.” - Clarification on this and if you mean increasing the lower / upper bound of the time range in which documents are searched for within. Would you be able to provide an example on this scenario as well?
  5. “so duplicates must always be filtered out” - How are possible duplicates created and do you see this often enough that it affects your results?

Regards,
Jason

1 Like