You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Add optional parameter '=' in property constraints (apache#1516)
- The '=' operator checks if the original property value(as a whole) is
equal to the given value.
e.g MATCH (n {school:{addr:{city:'Toronto'}}}) tranforms into
either(in case age.enable_containment is off)
`properties.school.addr.city = 'Toronto'`
or(in case age.enable_containment is on)
`properties @> {school:{addr:{city:'Toronto'}}}`
But MATCH (n ={school:{addr:{city:'Toronto'}}}) will tranform into
either(in case age.enable_containment is off)
`properties.school = {addr:{city:'Toronto'}}`
or(in case age.enable_containment is on)
`properties @>> {school:{addr:{city:'Toronto'}}}`
- Added @>> and <<@ operators. Unlike @> and <@, these operators does
not recurse into sub-objects.
- Added regression tests.
- Added changes in sql files to version update template file.
-- Using the test_enable_containment graph for these tests
3300
+
SELECT * FROM cypher('test_enable_containment', $$ CREATE p=(:Customer)-[:bought {store:'Amazon', addr:{city: 'Vancouver', street: 30}}]->(y:Product) RETURN p $$) as (a agtype);
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={addr:[{city:'Toronto'}]}) RETURN x $$) as (a agtype);
3310
+
count
3311
+
-------
3312
+
0
3313
+
(1 row)
3314
+
3315
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={school:{program:{major:'Psyc'}}}) RETURN x $$) as (a agtype);
3316
+
count
3317
+
-------
3318
+
0
3319
+
(1 row)
3320
+
3321
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={name:'Bob',school:{program:{degree:'BSc'}}}) RETURN x $$) as (a agtype);
3322
+
count
3323
+
-------
3324
+
0
3325
+
(1 row)
3326
+
3327
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={school:{program:{major:'Cs'}}}) RETURN x $$) as (a agtype);
3328
+
count
3329
+
-------
3330
+
0
3331
+
(1 row)
3332
+
3333
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={name:'Bob',school:{program:{degree:'PHd'}}}) RETURN x $$) as (a agtype);
3334
+
count
3335
+
-------
3336
+
0
3337
+
(1 row)
3338
+
3339
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={phone:[987654321]}) RETURN x $$) as (a agtype);
3340
+
count
3341
+
-------
3342
+
0
3343
+
(1 row)
3344
+
3345
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={phone:[654765876]}) RETURN x $$) as (a agtype);
3346
+
count
3347
+
-------
3348
+
0
3349
+
(1 row)
3350
+
3351
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x)-[:bought ={store: 'Amazon', addr:{city: 'Vancouver'}}]->() RETURN x $$) as (a agtype);
3352
+
count
3353
+
-------
3354
+
0
3355
+
(1 row)
3356
+
3357
+
-- Should return 1
3358
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={addr: [{city: 'Vancouver', street: 30},{city: 'Toronto', street: 40}]}) RETURN x $$) as (a agtype);
3359
+
count
3360
+
-------
3361
+
1
3362
+
(1 row)
3363
+
3364
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={school: { name: 'XYZ College',program: { major: 'Psyc', degree: 'BSc'}}}) RETURN x $$) as (a agtype);
3365
+
count
3366
+
-------
3367
+
1
3368
+
(1 row)
3369
+
3370
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={phone: [ 123456789, 987654321, 456987123 ]}) RETURN x $$) as (a agtype);
3371
+
count
3372
+
-------
3373
+
1
3374
+
(1 row)
3375
+
3376
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={school: { name: 'XYZ College',program: { major: 'Psyc', degree: 'BSc'} },phone: [ 123456789, 987654321, 456987123 ]}) RETURN x $$) as (a agtype);
3377
+
count
3378
+
-------
3379
+
1
3380
+
(1 row)
3381
+
3382
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH p=(x:Customer)-[:bought ={store: 'Amazon'}]->() RETURN p $$) as (a agtype);
3383
+
count
3384
+
-------
3385
+
1
3386
+
(1 row)
3387
+
3388
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH p=(x:Customer)-[:bought ={store: 'Amazon', addr:{city: 'Vancouver', street: 30}}]->() RETURN p $$) as (a agtype);
3389
+
count
3390
+
-------
3391
+
1
3392
+
(1 row)
3393
+
3394
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH p=(x:Customer)-[:bought {store: 'Amazon', addr:{city: 'Vancouver'}}]->() RETURN p $$) as (a agtype);
3395
+
count
3396
+
-------
3397
+
1
3398
+
(1 row)
3399
+
3400
+
SELECT * FROM cypher('test_enable_containment', $$ EXPLAIN (costs off) MATCH (x:Customer)-[:bought ={store: 'Amazon', addr:{city: 'Vancouver', street: 30}}]->(y:Product) RETURN 0 $$) as (a agtype);
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={addr:[{city:'Toronto'}]}) RETURN x $$) as (a agtype);
3426
+
count
3427
+
-------
3428
+
0
3429
+
(1 row)
3430
+
3431
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={school:{program:{major:'Psyc'}}}) RETURN x $$) as (a agtype);
3432
+
count
3433
+
-------
3434
+
0
3435
+
(1 row)
3436
+
3437
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={name:'Bob',school:{program:{degree:'BSc'}}}) RETURN x $$) as (a agtype);
3438
+
count
3439
+
-------
3440
+
0
3441
+
(1 row)
3442
+
3443
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={school:{program:{major:'Cs'}}}) RETURN x $$) as (a agtype);
3444
+
count
3445
+
-------
3446
+
0
3447
+
(1 row)
3448
+
3449
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={name:'Bob',school:{program:{degree:'PHd'}}}) RETURN x $$) as (a agtype);
3450
+
count
3451
+
-------
3452
+
0
3453
+
(1 row)
3454
+
3455
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={phone:[987654321]}) RETURN x $$) as (a agtype);
3456
+
count
3457
+
-------
3458
+
0
3459
+
(1 row)
3460
+
3461
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={phone:[654765876]}) RETURN x $$) as (a agtype);
3462
+
count
3463
+
-------
3464
+
0
3465
+
(1 row)
3466
+
3467
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x)-[:bought ={store: 'Amazon', addr:{city: 'Vancouver'}}]->() RETURN x $$) as (a agtype);
3468
+
count
3469
+
-------
3470
+
0
3471
+
(1 row)
3472
+
3473
+
-- Should return 1
3474
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={addr: [{city: 'Vancouver', street: 30},{city: 'Toronto', street: 40}]}) RETURN x $$) as (a agtype);
3475
+
count
3476
+
-------
3477
+
1
3478
+
(1 row)
3479
+
3480
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={school: { name: 'XYZ College',program: { major: 'Psyc', degree: 'BSc'}}}) RETURN x $$) as (a agtype);
3481
+
count
3482
+
-------
3483
+
1
3484
+
(1 row)
3485
+
3486
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={phone: [ 123456789, 987654321, 456987123 ]}) RETURN x $$) as (a agtype);
3487
+
count
3488
+
-------
3489
+
1
3490
+
(1 row)
3491
+
3492
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH (x:Customer ={school: { name: 'XYZ College',program: { major: 'Psyc', degree: 'BSc'} },phone: [ 123456789, 987654321, 456987123 ]}) RETURN x $$) as (a agtype);
3493
+
count
3494
+
-------
3495
+
1
3496
+
(1 row)
3497
+
3498
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH p=(x:Customer)-[:bought ={store: 'Amazon'}]->() RETURN p $$) as (a agtype);
3499
+
count
3500
+
-------
3501
+
1
3502
+
(1 row)
3503
+
3504
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH p=(x:Customer)-[:bought ={store: 'Amazon', addr:{city: 'Vancouver', street: 30}}]->() RETURN p $$) as (a agtype);
3505
+
count
3506
+
-------
3507
+
1
3508
+
(1 row)
3509
+
3510
+
SELECT count(*) FROM cypher('test_enable_containment', $$ MATCH p=(x:Customer)-[:bought {store: 'Amazon', addr:{city: 'Vancouver'}}]->() RETURN p $$) as (a agtype);
3511
+
count
3512
+
-------
3513
+
1
3514
+
(1 row)
3515
+
3516
+
SELECT * FROM cypher('test_enable_containment', $$ EXPLAIN (costs off) MATCH (x:Customer)-[:bought ={store: 'Amazon', addr:{city: 'Vancouver', street: 30}}]->(y:Product) RETURN 0 $$) as (a agtype);
0 commit comments