dgraph
dgraph copied to clipboard
[feature] uid_in query with QueryWithVars
is there any way to passing list of uid as []string{} for QueryWithVars ?
@u007 how would this work? The reason we use map is to match var name to value. If we send a slice, then we would need to create var-names. Correct? Please show a use case of this.
hi @srfrog , maybe something like
uid_in(field, ["0x878110", "0x06"])
or in go
values = []string{"0x878110", "0x06"}
uid_in(field, $values)
related to https://github.com/dgraph-io/dgraph4j/issues/97
it is already possible to do
follows @filter(uid_in(~follows, [0x1d, 0x1e, 0x20, 0x21]))
unfortunately, you can't do:
follows @filter(uid_in(~follows, $uids))
with multiple uids. Pinging @anurags92
you can do
follows @filter(uid_in(~follows, [$uids]))
#Message: : Value "0x1d, 0x1e, 0x20, 0x21" in uid_in is not a number
but even so, you can add multiple uids in the GraphQL Query.
Also, it is not possible to force the pseudo-array in the GraphQL Query:
query query($uids: string = "[0x1d, 0x1e, 0x20, 0x21]") {
query(func: has(follows)) @cascade
{
uid
follows @filter(uid_in(~follows, $uids))
{
uid
}
}
}
Github issues have been deprecated. This issue has been moved to discuss. You can follow the conversation there and also subscribe to updates by changing your notification preferences.
