Head's Up! These forums are read-only. All users and content have migrated. Please join us at community.neo4j.com.
04-13-2021 01:39 AM
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
04-15-2021 07:44 AM
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.
All the sessions of the conference are now available online