Hello,
I’m trying to destroy all nodes that match a query’s results.
This is what currently isn’t working.
// Get all sessions with a given session id.
const query = `
query getSession($sid: string) {
session as var(func: eq(sessionId, $sid)) {
uid
}
}
`
// Delete all of those sessions.
const mutation = new Mutation();
mutation.setDelNquads("uid(session) * * .");
const request = new Request();
request.setQuery(query);
request.addMutations(mutation);
request.setCommitNow(true);
I’m sure I’m missing something simple, but I’ve not had any luck figuring it out.