# \#area:querylang

**URL:** https://discuss.dgraph.io/tag/area-querylang/142.md

[Latest](https://discuss.dgraph.io/latest.md) · [Categories](https://discuss.dgraph.io/categories.md) · [Tags](https://discuss.dgraph.io/tags.md)

---

## [Query for nodes that do not have predicate with connection to specific user node](https://discuss.dgraph.io/t/query-for-nodes-that-do-not-have-predicate-with-connection-to-specific-user-node/19246)

<div class="topic-metadata">

**Author:** [@SunSparc](https://discuss.dgraph.io/u/SunSparc)\
**Replies:** 5\
**Last updated:** [March 27, 2024, 9:21pm UTC](https://discuss.dgraph.io/t/query-for-nodes-that-do-not-have-predicate-with-connection-to-specific-user-node/19246 "2024-03-27T21:21:30Z")

</div>

I have a node (type “Post”). That node is connected to many images. Each image can have comments. Each comment can be connected to one user. I need to query for all images. Each image returned should not have a comment…

---

## [Unique Constraint on string](https://discuss.dgraph.io/t/unique-constraint-on-string/18371)

<div class="topic-metadata">

**Author:** [@MB175](https://discuss.dgraph.io/u/MB175)\
**Replies:** 9\
**Last updated:** [March 14, 2023, 5:20pm UTC](https://discuss.dgraph.io/t/unique-constraint-on-string/18371 "2023-03-14T17:20:55Z")

</div>

Hi, I want to set a unique constraint on containerId so only one Node per ID is created I tried upsert and indexes with dgo, nothing works? Can this be done? \[{ "name": "test1", "parent": { …

---

## [Is it possible to set the return type in a DQL query for a GraphQL result?](https://discuss.dgraph.io/t/is-it-possible-to-set-the-return-type-in-a-dql-query-for-a-graphql-result/17810)

<div class="topic-metadata">

**Author:** [@Poolshark](https://discuss.dgraph.io/u/Poolshark)\
**Replies:** 3\
**Last updated:** [October 12, 2022, 4:15pm UTC](https://discuss.dgraph.io/t/is-it-possible-to-set-the-return-type-in-a-dql-query-for-a-graphql-result/17810 "2022-10-12T16:15:22Z")

</div>

I recently ran into the issue that if a type implements one or more interfaces, the return type from a DQL query will always be an array. If I know what kind of type I expect can I somehow “pick” the right one from the a…

---

## [Question about @recurse with expand(\_all\_)](https://discuss.dgraph.io/t/question-about-recurse-with-expand-all/17800)

<div class="topic-metadata">

**Author:** [@Poolshark](https://discuss.dgraph.io/u/Poolshark)\
**Replies:** 0\
**Last updated:** [September 23, 2022, 4:21pm UTC](https://discuss.dgraph.io/t/question-about-recurse-with-expand-all/17800 "2022-09-23T16:21:51Z")

</div>

I hope this is the right category for this question. I was recently experimenting with the @recurse directive in combination with expand(\_all\_). I found that doing so very quickly gets you in big troubles since (at leas…

---

## [Add @distance for geo](https://discuss.dgraph.io/t/add-distance-for-geo/8406)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 9\
**Last updated:** [September 21, 2022, 2:15am UTC](https://discuss.dgraph.io/t/add-distance-for-geo/8406 "2022-09-21T02:15:04Z")

</div>

Moved from GitHub dgraph/1559 Posted by davedbase: It would be really great if there was a function to call and return distance between points or polygons. ie. @distance(PointA, PointB). If it were to return the result…

---

## [Improve Facets functions. (not supported in preprocessFilter)](https://discuss.dgraph.io/t/improve-facets-functions-not-supported-in-preprocessfilter/8434)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 4\
**Last updated:** [July 13, 2022, 6:45am UTC](https://discuss.dgraph.io/t/improve-facets-functions-not-supported-in-preprocessfilter/8434 "2022-07-13T06:45:00Z")

</div>

Moved from GitHub dgraph/2896 Posted by MichelDiz: What you wanted to do I tried beef up the queries for facets to add in the documentation. Especially for fulltext. https://docs.dgraph.io/query-language/#filtering-on…

---

## [Support lists in query variables (Dgraph's GraphQL Variable)](https://discuss.dgraph.io/t/support-lists-in-query-variables-dgraphs-graphql-variable/8758)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 18\
**Last updated:** [May 20, 2022, 8:41am UTC](https://discuss.dgraph.io/t/support-lists-in-query-variables-dgraphs-graphql-variable/8758 "2022-05-20T08:41:40Z")

</div>

Moved from GitHub dgraph/2726 Posted by F21: Experience Report I often have queries where I want to match a list of things (similar to an IN query in SQL). For example: { someQuery(func: eq(somePredicate, val1, val2…

---

## [Support value variables for paging params (offset, after, first)](https://discuss.dgraph.io/t/support-value-variables-for-paging-params-offset-after-first/8753)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 10\
**Last updated:** [March 16, 2022, 8:48am UTC](https://discuss.dgraph.io/t/support-value-variables-for-paging-params-offset-after-first/8753 "2022-03-16T08:48:23Z")

</div>

Moved from GitHub dgraph/2564 Posted by disconsented: { var(func: eq(account, "100")){ client{ cid as uid } msg as message\_limit } messageCount(func: uid(cid)){ count(messages) messages…

---

## [Query count number of times of each value appears in a query](https://discuss.dgraph.io/t/query-count-number-of-times-of-each-value-appears-in-a-query/16869)

<div class="topic-metadata">

**Author:** [@gwajnberg](https://discuss.dgraph.io/u/gwajnberg)\
**Replies:** 0\
**Last updated:** [February 18, 2022, 9:51pm UTC](https://discuss.dgraph.io/t/query-count-number-of-times-of-each-value-appears-in-a-query/16869 "2022-02-18T21:51:34Z")

</div>

Hello all, I have a schema like bellow: type Sample { Sample\_name Sample\_type collectedFrom } type FoodProduct { Name Description sourced isAnimalSource } type AnimalSource { Name } I would like to do a …

---

## [Eq list with val() does not return all matches](https://discuss.dgraph.io/t/eq-list-with-val-does-not-return-all-matches/8572)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 1\
**Last updated:** [February 7, 2022, 11:25pm UTC](https://discuss.dgraph.io/t/eq-list-with-val-does-not-return-all-matches/8572 "2022-02-07T23:25:37Z")

</div>

Moved from GitHub dgraph/5770 Posted by danielmai: What version of Dgraph are you using? v20.03.3 Have you tried reproducing the issue with the latest release? Yes What is the hardware spec (RAM, OS)? Ubuntu Linux, …

---

## [How to query an array field by count (or check for emptiness)](https://discuss.dgraph.io/t/how-to-query-an-array-field-by-count-or-check-for-emptiness/15722)

<div class="topic-metadata">

**Author:** [@Tyler\_D](https://discuss.dgraph.io/u/Tyler_D)\
**Replies:** 4\
**Last updated:** [October 5, 2021, 2:55am UTC](https://discuss.dgraph.io/t/how-to-query-an-array-field-by-count-or-check-for-emptiness/15722 "2021-10-05T02:55:18Z")

</div>

Lets say you have a schema like so. type school { students: \[student\] } type student { name: String } How would you be able to query schools that have X number of students or schools that are empty of students? Som…

---

## [Allow value variables in facet filters](https://discuss.dgraph.io/t/allow-value-variables-in-facet-filters/8751)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 4\
**Last updated:** [July 22, 2021, 4:55pm UTC](https://discuss.dgraph.io/t/allow-value-variables-in-facet-filters/8751 "2021-07-22T16:55:01Z")

</div>

Moved from GitHub dgraph/2406 Posted by djdoeslinux: I would love to be able to interpolate value variables into @facet statements similarly to @filter statements. This would enable a new class of query dependent trave…

---

## [Use GraphQL Vars In regex](https://discuss.dgraph.io/t/use-graphql-vars-in-regex/12212)

<div class="topic-metadata">

**Author:** [@spinelsun](https://discuss.dgraph.io/u/spinelsun)\
**Replies:** 7\
**Last updated:** [June 14, 2021, 12:08pm UTC](https://discuss.dgraph.io/t/use-graphql-vars-in-regex/12212 "2021-06-14T12:08:29Z")

</div>

I Want to Do Use GQL variables in DQL query inside a regex filter What I Did query find\_user($term: string){ find\_user(func: type(User)) @filter(regexp(User.username, /$term/i) or regexp(User.email, /^$term/i)){ u…

---

## [\[RFC\] TF-IDF scoring for fulltext search in Dgraph](https://discuss.dgraph.io/t/rfc-tf-idf-scoring-for-fulltext-search-in-dgraph/14090)

<div class="topic-metadata">

**Author:** [@ajeet](https://discuss.dgraph.io/u/ajeet)\
**Replies:** 6\
**Last updated:** [June 3, 2021, 8:51am UTC](https://discuss.dgraph.io/t/rfc-tf-idf-scoring-for-fulltext-search-in-dgraph/14090 "2021-06-03T08:51:49Z")

</div>

Motivation Dgraph already supports fulltext search via the DQL function anyoftext, but it does not currently expose a score to the user. It would be very useful for anyone building search functionality on top of Dgraph t…

---

## [Create edges upon custom id](https://discuss.dgraph.io/t/create-edges-upon-custom-id/12779)

<div class="topic-metadata">

**Author:** [@spinelsun](https://discuss.dgraph.io/u/spinelsun)\
**Replies:** 4\
**Last updated:** [February 15, 2021, 3:04pm UTC](https://discuss.dgraph.io/t/create-edges-upon-custom-id/12779 "2021-02-15T15:04:16Z")

</div>

Hi, I wanted to know if it is possible to create edges on self-generated ids instead of the UIDs created by the DB. It is important to me because sometimes I want to replace a node with a newer node have that node all t…

---

## [Delete Root node and all of its hierarchy](https://discuss.dgraph.io/t/delete-root-node-and-all-of-its-hierarchy/12605)

<div class="topic-metadata">

**Author:** [@spinelsun](https://discuss.dgraph.io/u/spinelsun)\
**Replies:** 1\
**Last updated:** [February 3, 2021, 3:41pm UTC](https://discuss.dgraph.io/t/delete-root-node-and-all-of-its-hierarchy/12605 "2021-02-03T15:41:29Z")

</div>

I Want to Do Delete a root node with all of its sub-nodes down to the leaves Schema \<created\_by\>: uid . \<Artifact.module\>: string . \<Artifact.name\>: string @index(hash, trigram) . \<Artifact.cuid\>: string . \<Artifact.tic\>…

---

## [Feature request: full text search with tf-idf Scoring](https://discuss.dgraph.io/t/feature-request-full-text-search-with-tf-idf-scoring/8766)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 11\
**Last updated:** [January 11, 2021, 1:03am UTC](https://discuss.dgraph.io/t/feature-request-full-text-search-with-tf-idf-scoring/8766 "2021-01-11T01:03:28Z")

</div>

Moved from GitHub dgraph/3211 Posted by pjebs: Bleve supports tf-idf Scoring. It would be great if there was a function that could filter based on scoring by relevance. The function would accept an argument where we s…

---

## [Skip or Include DQL](https://discuss.dgraph.io/t/skip-or-include-dql/12147)

<div class="topic-metadata">

**Author:** [@spinelsun](https://discuss.dgraph.io/u/spinelsun)\
**Replies:** 4\
**Last updated:** [January 5, 2021, 9:03am UTC](https://discuss.dgraph.io/t/skip-or-include-dql/12147 "2021-01-05T09:03:11Z")

</div>

Hi, Is there anything similar to the @skip and @include directive in DQL? Thanks, Spinelsun

---

## [Order Results](https://discuss.dgraph.io/t/order-results/12027)

<div class="topic-metadata">

**Author:** [@spinelsun](https://discuss.dgraph.io/u/spinelsun)\
**Replies:** 6\
**Last updated:** [December 27, 2020, 9:14pm UTC](https://discuss.dgraph.io/t/order-results/12027 "2020-12-27T21:14:29Z")

</div>

Hi, I have a data model that goes like this: type \<Repository\> { Repository.name Repository.active\_memberships } type \<Membership\> { Membership.role Membership.created\_at Membership.of\_user } type \<User\> { User.u…

---

## [GraphQL doesn't preserve order of edges in a collection](https://discuss.dgraph.io/t/graphql-doesnt-preserve-order-of-edges-in-a-collection/8860)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 6\
**Last updated:** [December 17, 2020, 11:03pm UTC](https://discuss.dgraph.io/t/graphql-doesnt-preserve-order-of-edges-in-a-collection/8860 "2020-12-17T23:03:57Z")

</div>

Moved from GitHub dgraph/5816 Posted by martaver: Steps to reproduce the issue (command/config used to run Dgraph). Using slash graphql, given the schema: type Player { id: ID! title: String! @search(by: \[fulltext…

---

## [How to delete a node](https://discuss.dgraph.io/t/how-to-delete-a-node/11645)

<div class="topic-metadata">

**Author:** [@spinelsun](https://discuss.dgraph.io/u/spinelsun)\
**Replies:** 14\
**Last updated:** [November 26, 2020, 9:03pm UTC](https://discuss.dgraph.io/t/how-to-delete-a-node/11645 "2020-11-26T21:03:57Z")

</div>

Hi, I have the following schema: \<ApiKeySet.title\>: string . \<ApiKeySet.access\_key\>: string @index(hash) @upsert . \<ApiKeySet.secret\_key\>: password . \<ApiKeySet.last\_used\>: datetime . \<ApiKeySet.created\_at\>: datetime .…

---

## [Filter with eq list argument behaves differently without index](https://discuss.dgraph.io/t/filter-with-eq-list-argument-behaves-differently-without-index/8571)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 3\
**Last updated:** [November 25, 2020, 3:12pm UTC](https://discuss.dgraph.io/t/filter-with-eq-list-argument-behaves-differently-without-index/8571 "2020-11-25T15:12:36Z")

</div>

Moved from GitHub dgraph/5767 Posted by danielmai: What version of Dgraph are you using? v20.03.3 Have you tried reproducing the issue with the latest release? Yes What is the hardware spec (RAM, OS)? Ubuntu Linux, …

---

## [Something wrong with upsert](https://discuss.dgraph.io/t/something-wrong-with-upsert/11589)

<div class="topic-metadata">

**Author:** [@spinelsun](https://discuss.dgraph.io/u/spinelsun)\
**Replies:** 4\
**Last updated:** [November 23, 2020, 1:57pm UTC](https://discuss.dgraph.io/t/something-wrong-with-upsert/11589 "2020-11-23T13:57:27Z")

</div>

Hi, This is my User type: \<User.username\>: string @index(hash, trigram) @upsert . \<User.full\_name\>: string @index(term) @lang . \<User.email\>: string @index(hash, trigram) @upsert . \<User.joined\_on\>: datetime @index(mon…

---

## [@reverse dircetive](https://discuss.dgraph.io/t/reverse-dircetive/11536)

<div class="topic-metadata">

**Author:** [@spinelsun](https://discuss.dgraph.io/u/spinelsun)\
**Replies:** 7\
**Last updated:** [November 23, 2020, 8:14am UTC](https://discuss.dgraph.io/t/reverse-dircetive/11536 "2020-11-23T08:14:06Z")

</div>

Hi, @MichelDiz I am using dql and I have two types user and membership membership has a predicate ofUser of type uid and I linked it to the user type. I also added the reverse directive. My questions are: will I b…

---

## [Insert many connection in one line](https://discuss.dgraph.io/t/insert-many-connection-in-one-line/11576)

<div class="topic-metadata">

**Author:** [@spinelsun](https://discuss.dgraph.io/u/spinelsun)\
**Replies:** 3\
**Last updated:** [November 23, 2020, 4:39am UTC](https://discuss.dgraph.io/t/insert-many-connection-in-one-line/11576 "2020-11-23T04:39:54Z")

</div>

Hi, I have in my scheme a predicate who is a type of \[uid\]. I want to set many uids in one line but I can’t mange to do that. Instead of doing something like this: \_:r1 \<Repository.active\_memberships\> \[\_:m1, \_m2\] . I…

---

## [Behavior of cascade not clear with aggregation](https://discuss.dgraph.io/t/behavior-of-cascade-not-clear-with-aggregation/8449)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 3\
**Last updated:** [November 16, 2020, 11:06am UTC](https://discuss.dgraph.io/t/behavior-of-cascade-not-clear-with-aggregation/8449 "2020-11-16T11:06:58Z")

</div>

Moved from GitHub dgraph/4024 Posted by animesh2049: What version of Dgraph are you using? version: 5b20d411f7cb21fe575503e70f60ca48bb794bb1 Steps to reproduce the issue and expected behaviour and actual result. Beha…

---

## [Is there a rand option for dgraph?](https://discuss.dgraph.io/t/is-there-a-rand-option-for-dgraph/11213)

<div class="topic-metadata">

**Author:** [@tintinthong](https://discuss.dgraph.io/u/tintinthong)\
**Replies:** 1\
**Last updated:** [October 30, 2020, 12:32pm UTC](https://discuss.dgraph.io/t/is-there-a-rand-option-for-dgraph/11213 "2020-10-30T12:32:58Z")

</div>

In mongo you can sample n documents in the database. Is there an equivalent operator in dgraph? Or is there a workaround apart from sampling within my server process?

---

## [Uid functionality in multiple mutations](https://discuss.dgraph.io/t/uid-functionality-in-multiple-mutations/10916)

<div class="topic-metadata">

**Author:** [@dewwrat](https://discuss.dgraph.io/u/dewwrat)\
**Replies:** 1\
**Last updated:** [October 14, 2020, 4:33am UTC](https://discuss.dgraph.io/t/uid-functionality-in-multiple-mutations/10916 "2020-10-14T04:33:59Z")

</div>

With this mutation, the Graph is plotted as two different bookings but sharing the same vehicle and the driver { "set": \[{ "crn": 4820651604, "uid" : "\_:4820651604", "vehicle": \[ { …

---

## [Provide unique index support for GraphQL+-](https://discuss.dgraph.io/t/provide-unique-index-support-for-graphql/8538)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 3\
**Last updated:** [October 8, 2020, 4:56am UTC](https://discuss.dgraph.io/t/provide-unique-index-support-for-graphql/8538 "2020-10-08T04:56:23Z")

</div>

Moved from GitHub dgraph/5512 Posted by sessionboy: What you wanted to do I am using GraphQL ±. I want to achieve a unique index at the database level. I know that GraphQL is planning to support it, but I hope that Gr…

---

## [Cannot find value without language tag](https://discuss.dgraph.io/t/cannot-find-value-without-language-tag/8539)

<div class="topic-metadata">

**Author:** [@diggy](https://discuss.dgraph.io/u/diggy)\
**Replies:** 7\
**Last updated:** [September 30, 2020, 8:49pm UTC](https://discuss.dgraph.io/t/cannot-find-value-without-language-tag/8539 "2020-09-30T20:49:16Z")

</div>

Moved from GitHub dgraph/5523 Posted by jarifibrahim: What version of Dgraph are you using? Master https://github.com/dgraph-io/dgraph/commit/cc9795734359d816606fe454ba997b7800a6bdfd Steps to reproduce the issue (com…

[Next page](https://discuss.dgraph.io/tag/area-querylang/142.md?match_all_tags=true&page=1&tags%5B%5D=area%3Aquerylang)
