Closed ghukill closed 5 years ago
With a membrane between SQL and Mongo, there is possibility that Records may exist in Mongo but not have an associated Job.
They can be removed with:
job_ids = list(Job.objects.values_list('id', flat=True)) mc_handle.combine.record.delete_many({'job_id':{'$nin':job_ids}})
But where to put this? Might be related to housekeeping of ensuring indexes with #260
Added as manage.py command
manage.py
With a membrane between SQL and Mongo, there is possibility that Records may exist in Mongo but not have an associated Job.
They can be removed with:
But where to put this? Might be related to housekeeping of ensuring indexes with #260