"select * from prefixes where '+39123412341' like prefix || '%" in GraphQL

Dear Friends

I want to port old SQL telephone numer database to Neo. The database instead of full 11-digit tel. numbers contains prefixes ( e.g.) +38,+391, +3912. Then I search for all records which start the given full telephone numer:

select * from prefixes where '+39123412341' like prefix || '%';

Assuming that the table contains the following prefixes ( +38, +391, +3912, +392) the query returns ( +391, +3912)

Friends I wonder if such query can be effectively written and executed in GraphQL.

Can anyone of you point me in the right direction.

Regards

Jacek

You're better off with multiple queries against an index.

MATCH (n:SomePrefixes { prefix: substring($myNumber, 0, $i) }) RETURN n.prefix

However, I'm a bit confused why you'd want to do this. If you're trying to find out some other related info for the user like what location they're in, or what not, that makes sense, but returning the prefix itself... Seems pointless.