MI-DPLA / combine

Combine /kämˌbīn/ - Metadata Aggregator Platform
MIT License
26 stars 11 forks source link

orphaned Records in Mongo not associated with Job #261

Closed ghukill closed 5 years ago

ghukill commented 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

ghukill commented 5 years ago

Added as manage.py command