NameSpace - person Set - personData PersonId (Key) | name | birthDate NameSpace - person Set - cityVisitedData PersonId+CityVisited (Key)| cityName | personId
Here person can have many city visited. Use case is that if someone deletes person record then all city visited record should be deleted. I have secondary index on personid for cityVisitedData set. If i delete using PK (PersonId+CityVisited) then only one record will be deleted. But I want to delete all records containing person id. I checked the delete api where it takes key and also tried passing personId in that key but it does not delete anything.
Key key = new Key("person", "cityVisitedData", Value.get(personId)); client.delete(writePolicy, key);
The above code does not delete any record.