Wildcard search

Hi.

I have a solution working but I have a request for wildcard search and I can’t find anything about this.

From a SQL query it would look something like this: select * from mytable where myfield like ‘abc*’
and it would return all rows from mytable where myfield start with “abc”.

Is something like this possible in dgraph, dql?

and if yes can anyone point me to the documentation how it’s done.

Thank in advance.

Lasse Nedergaard

Hi Lasse,

Welcome.

Well. There’s no concept of Tables in Graph databases. If you wanna all records from a given type it should be something like

{
   q(func: type(Customers)) {
      expand(_all_)
   }
}

See this intro for SQL users

https://dgraph.io/learn/courses/datamodel/sql-to-dgraph/overview/introduction/

This can be useful

Sorry if I don’t express myself good enough. (It has nothing to do with SQL and tables.)

The question is can I do a wildcard search in dgraph, and in that case how do I do it.

We don’t have this. But we have Regex.
https://dgraph.io/docs/query-language/functions/#regular-expressions

Ok. Thanks for clearing it out.

I will take a look at see how I can use it.

Thanks.