Now I'm trying to use this to check it:
List<Tool__c> tools = [
SELECT Id
FROM Tool__c
WHERE Date__c >= 2019-09-11T00:00:00.000Z
];
for (Tool__c t : tools) {
//And I'll get here 101 limits because of SOQL in the loop, yeah:
List<Gear__c> gears = [
SELECT Id
FROM Gear__c
WHERE Tool__c = :t.Id
ORDER BY CreatedDate
];
if (gears.size() > 1) {
System.debug(gears);
}
}
I'm also trying this fragment:
List<Tool__c> tools = [
SELECT
Id,
(
SELECT Id
FROM Gears__r
)
FROM Tool__c
WHERE Date__c >= 2019-09-11T00:00:00.000Z
ORDER BY Id
];
But I still have no idea, how to do it right. Help me, please.