MongoDB.live, free & fully virtual. June 9th - 10th. Register Now

Stop and resume queries

Hello Everyone Mongo newbie here,
I was wondering if anyone of you have encountered a long running query that might take days to run. I wanted to know if, there is any way around of implementing a resume function or restarting a query from a checkpoint.

Thanks in advance!

Welcome to the community @okay_lucid!

It’s definitely atypical to have queries that run for days, and there is no concept of pausing a query.

I suggest looking into Materialized Views in MongoDB 4.2+, which would allow you to incrementally merge data into a result collection.

You may also want to look into some of the data model patterns in the Building with Patterns blog post series. In particular, the Bucket or Computed patterns might be relevant.

Regards,
Stennie