I've got an employees collection that looks like:
{
_id
company_id
job_type
name
age
...
}
And a remove query that looks like:
val criteria = Criteria.where("company_id").isEqualTo(companyId).and("job_type").isEqualTo(jobType)
val query = Query(criteria).limit(3)
When I run it like:
mongoTemplate.remove(query, null, "collection_name")
It works great:)
Buy when I run it in Bulk Ops like:
val bulkOp = mongoTemplate.bulkOps(BulkOperations.BulkMode.UNORDERED, null, "collection_name")
bulkOp.remove(query)
...
bulkOp.execute()
It removes all of the documents for that company & job type while completely ignoring the limit=3
Is there a solution for the issue?