Open TheMrguiller opened 4 months ago
Hi @TheMrguiller and thank you for opening this issue.
contains()
is a function in Memgraph, which we use like this in a Cypher query:
contains(string: string, substring: string) -> (boolean)
We didn't implement a wrapper around this for now, so to do that, you should run smth similar to following query as a workaround:
results = list(
match()
.node(labels="Organizations", variable="o")
.add_custom_cypher("WHERE contains(o.name, " + organization["name"] + ")")
.return_()
.execute()
)
Just tweak/escape the quotes in organization name if needed.
I will leave this issue opened because we should implement functions in the query builder.
Hi @katarinasupe ,
Thank you so much for your response. In the case of wanting to add operators like STARTS WITH and ENDS WITH, could we do in the same way?
Yes @TheMrguiller, you do the same for all functions. Here are the string ones - https://memgraph.com/docs/querying/functions#string-functions. For example, STARTS WITH and ENDS WITH are startsWith and endsWith.
What are you working on? Can you tell me more about the use case?
Yes, we are conducting a proof of concept for using Memgraph with Langchain, and we have encountered documents with errors in them. For instance, some names of people are not fully specified or company names are missing their original S.A. designation. Since we don't have the exact, error-free strings, we are aiming to minimize duplicates by utilizing the 'contains' and 'startswith' operators.
@TheMrguiller I get it! Sounds like a cool use case. Keep me posted on how the PoC goes, I would love to get your feedback on Memgraph. If you will need more help, feel free to schedule an office hours call and join our Discord server where you can ask various questions about Memgraph.
Hi,
I am new to memgraph and i have observe that there is not documentation on how to use string-specific comparison operators. I have tried the following. but with no success:
¿Is there any work arounds?