-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to use labels(n)[0] in where? #98
Comments
Hi Beshoo! Unfortunately, this syntax is not yet supported, but you can use a raw expression to emulate it: use function WikibaseSolutions\CypherDSL\node;
use function WikibaseSolutions\CypherDSL\procedure;
use function WikibaseSolutions\CypherDSL\query;
use function WikibaseSolutions\CypherDSL\raw;
require __DIR__ . '/../vendor/autoload.php';
$n = node();
$query = query()
->match($n)
->where(
$n->property('status')->equals(0)->or($n->property('status')->equals('0'))
->and($n->property('lableb')->isNull())
->and(
raw(procedure()::raw('labels', $n)->toQuery() . '[0]')->equals("CharactourM")
->or(
raw(procedure()::raw('labels', $n)->toQuery() . '[0]')->equals("CompanyM"))))
->returning([
raw(procedure()::raw('labels', $n)->toQuery() . '[0]')
->alias('label'),
procedure()::raw('count', $n)
->alias('count')
], distinct: true)
->toQuery(); The syntax for raw queries and procedures is rather ugly. I'll see if I can make some improvements. |
@marijnvanwezel Thank you for your reply. However, my manager finds this raw difficult to understand, as you already said it is ugly . Can we expect any updates in the upcoming days? |
Hi @beshoo, I would not expect an update that fixes this in the coming days. The project this library was initially developed for is no longer being worked on, which put this library on the backburner as well. I am willing to spend some time reviewing potential pull requests! :) |
I did my best to understand the HowItWorks library, but unfortunately, shame on me, I don't think I have the skills to create a pull request for it. However, I believe it's crucial to support the 'label' feature in this case since neo4J is all about labels! Right? Could you please add this support to the library since you know where and how to do it? I am kindly requesting an exception and a big favor for both me and the community. Thank you so much! |
I will see if I can get some hours to work on this. |
I have this code, but am confused about how to convert it! even ChatGPT doesn't know LOL
BTW: the documentation does not cover all aspects of this great lib, is there another doc?
Thank you
The text was updated successfully, but these errors were encountered: