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.
Should I be using dql variables in this case? I’m concerned that if the behavior is unintentional, it may be patched out later. I trust the source of the value so putting the value directly into the template would work just as well for me.
If it works for you, you can keep using DQL Vars. And now I know that it works on clients. Need to check if it works via RAW HTTP request. One thing I know is that DQL really doesn’t work on Ratel with custom value on the DQL Vars.