Hello guys!
I need an advise. My task is to delete some documents in collection.
Del algorithm is following:
Group docs by field1 with sort by field2 and delete every 3 and following
occurrences in every group.
Unfortunately I didn't find easy way to do so.
Closest approach was to use group.offset = 2, but result set is polluted with
empty groups with no documents (they have less then 3 docs in group).
May be I'm missing smth and there is way not to receive empty groups in results?
Next approach was to use facet first with facet.mincount=3, then find docs ids
by every facet result and then delete docs by id.
That way seems to me too complicated for the task.
What's the best use case for the task?