@@ -507,9 +507,6 @@ function printTraversalDetails(traversals) {
507
507
uniqueVertices : options . uniqueVertices ,
508
508
uniqueEdges : options . uniqueEdges
509
509
} ;
510
- if ( options . vertexCollections !== undefined ) {
511
- opts . vertexCollections = options . vertexCollections ;
512
- }
513
510
514
511
var result = '' ;
515
512
for ( var att in opts ) {
@@ -1103,7 +1100,7 @@ function processQuery(query, explain, planIndex) {
1103
1100
} ;
1104
1101
1105
1102
var label = function ( node ) {
1106
- var rc , v , e , edgeCols , i , d , directions , isLast ;
1103
+ var rc , v , vNames , e , eNames , edgeCols , i , d , directions , isLast ;
1107
1104
var parts = [ ] ;
1108
1105
var types = [ ] ;
1109
1106
var filter = '' ;
@@ -1296,27 +1293,62 @@ function processQuery(query, explain, planIndex) {
1296
1293
}
1297
1294
1298
1295
e = [ ] ;
1296
+ eNames = [ ] ;
1299
1297
if ( node . hasOwnProperty ( 'graphDefinition' ) ) {
1300
1298
v = [ ] ;
1301
- node . graphDefinition . vertexCollectionNames . forEach ( function ( vcn ) {
1302
- v . push ( collection ( vcn ) ) ;
1303
- } ) ;
1299
+ vNames = [ ] ;
1300
+ if ( node . hasOwnProperty ( 'options' ) && node . options . hasOwnProperty ( 'vertexCollections' ) ) {
1301
+ node . options . vertexCollections . forEach ( function ( vcn ) {
1302
+ v . push ( collection ( vcn ) ) ;
1303
+ vNames . push ( vcn ) ;
1304
+ } ) ;
1305
+ } else {
1306
+ node . graphDefinition . vertexCollectionNames . forEach ( function ( vcn ) {
1307
+ v . push ( collection ( vcn ) ) ;
1308
+ vNames . push ( vcn ) ;
1309
+ } ) ;
1310
+ }
1304
1311
node . vertexCollectionNameStr = v . join ( ', ' ) ;
1305
- node . vertexCollectionNameStrLen = node . graphDefinition . vertexCollectionNames . join ( ', ' ) . length ;
1312
+ node . vertexCollectionNameStrLen = vNames . join ( ', ' ) . length ;
1306
1313
1307
- node . graphDefinition . edgeCollectionNames . forEach ( function ( ecn ) {
1308
- e . push ( collection ( ecn ) ) ;
1309
- } ) ;
1314
+ if ( node . hasOwnProperty ( 'options' ) && node . options . hasOwnProperty ( 'edgeCollections' ) ) {
1315
+ node . options . edgeCollections . forEach ( function ( ecn ) {
1316
+ e . push ( collection ( ecn ) ) ;
1317
+ eNames . push ( ecn ) ;
1318
+ } ) ;
1319
+ } else {
1320
+ node . graphDefinition . edgeCollectionNames . forEach ( function ( ecn ) {
1321
+ e . push ( collection ( ecn ) ) ;
1322
+ eNames . push ( ecn ) ;
1323
+ } ) ;
1324
+ }
1310
1325
node . edgeCollectionNameStr = e . join ( ', ' ) ;
1311
- node . edgeCollectionNameStrLen = node . graphDefinition . edgeCollectionNames . join ( ', ' ) . length ;
1326
+ node . edgeCollectionNameStrLen = eNames . join ( ', ' ) . length ;
1312
1327
} else {
1313
- edgeCols = node . graph || [ ] ;
1314
- edgeCols . forEach ( function ( ecn ) {
1315
- e . push ( collection ( ecn ) ) ;
1316
- } ) ;
1328
+ if ( node . hasOwnProperty ( 'options' ) && node . options . hasOwnProperty ( 'edgeCollections' ) ) {
1329
+ node . options . edgeCollections . forEach ( function ( ecn ) {
1330
+ e . push ( collection ( ecn ) ) ;
1331
+ eNames . push ( ecn ) ;
1332
+ } ) ;
1333
+ } else {
1334
+ edgeCols = node . graph || [ ] ;
1335
+ edgeCols . forEach ( function ( ecn ) {
1336
+ e . push ( collection ( ecn ) ) ;
1337
+ eNames . push ( ecn ) ;
1338
+ } ) ;
1339
+ }
1317
1340
node . edgeCollectionNameStr = e . join ( ', ' ) ;
1318
- node . edgeCollectionNameStrLen = edgeCols . join ( ', ' ) . length ;
1341
+ node . edgeCollectionNameStrLen = eNames . join ( ', ' ) . length ;
1319
1342
node . graph = '<anonymous>' ;
1343
+
1344
+ if ( node . hasOwnProperty ( 'options' ) && node . options . hasOwnProperty ( 'vertexCollections' ) ) {
1345
+ v = [ ] ;
1346
+ node . options . vertexCollections . forEach ( function ( vcn ) {
1347
+ v . push ( collection ( vcn ) ) ;
1348
+ } ) ;
1349
+ node . vertexCollectionNameStr = v . join ( ', ' ) ;
1350
+ node . vertexCollectionNameStrLen = node . options . vertexCollections . join ( ', ' ) . length ;
1351
+ }
1320
1352
}
1321
1353
1322
1354
allIndexes . forEach ( function ( idx ) {
@@ -1374,27 +1406,61 @@ function processQuery(query, explain, planIndex) {
1374
1406
1375
1407
shortestPathDetails . push ( node ) ;
1376
1408
e = [ ] ;
1409
+ eNames = [ ] ;
1377
1410
if ( node . hasOwnProperty ( 'graphDefinition' ) ) {
1378
1411
v = [ ] ;
1379
- node . graphDefinition . vertexCollectionNames . forEach ( function ( vcn ) {
1380
- v . push ( collection ( vcn ) ) ;
1381
- } ) ;
1412
+ vNames = [ ] ;
1413
+ if ( node . hasOwnProperty ( 'options' ) && node . options . hasOwnProperty ( 'vertexCollections' ) ) {
1414
+ node . options . vertexCollections . forEach ( function ( vcn ) {
1415
+ v . push ( collection ( vcn ) ) ;
1416
+ vNames . push ( vcn ) ;
1417
+ } ) ;
1418
+ } else {
1419
+ node . graphDefinition . vertexCollectionNames . forEach ( function ( vcn ) {
1420
+ v . push ( collection ( vcn ) ) ;
1421
+ vNames . push ( vcn ) ;
1422
+ } ) ;
1423
+ }
1382
1424
node . vertexCollectionNameStr = v . join ( ', ' ) ;
1383
- node . vertexCollectionNameStrLen = node . graphDefinition . vertexCollectionNames . join ( ', ' ) . length ;
1425
+ node . vertexCollectionNameStrLen = vNames . join ( ', ' ) . length ;
1384
1426
1385
- node . graphDefinition . edgeCollectionNames . forEach ( function ( ecn ) {
1386
- e . push ( collection ( ecn ) ) ;
1387
- } ) ;
1427
+ if ( node . hasOwnProperty ( 'options' ) && node . options . hasOwnProperty ( 'edgeCollections' ) ) {
1428
+ node . options . edgeCollections . forEach ( function ( ecn ) {
1429
+ e . push ( collection ( ecn ) ) ;
1430
+ eNames . push ( ecn ) ;
1431
+ } ) ;
1432
+ } else {
1433
+ node . graphDefinition . edgeCollectionNames . forEach ( function ( ecn ) {
1434
+ e . push ( collection ( ecn ) ) ;
1435
+ eNames . push ( ecn ) ;
1436
+ } ) ;
1437
+ }
1388
1438
node . edgeCollectionNameStr = e . join ( ', ' ) ;
1389
- node . edgeCollectionNameStrLen = node . graphDefinition . edgeCollectionNames . join ( ', ' ) . length ;
1439
+ node . edgeCollectionNameStrLen = eNames . join ( ', ' ) . length ;
1390
1440
} else {
1391
- edgeCols = node . graph || [ ] ;
1392
- edgeCols . forEach ( function ( ecn ) {
1393
- e . push ( collection ( ecn ) ) ;
1394
- } ) ;
1441
+ if ( node . hasOwnProperty ( 'options' ) && node . options . hasOwnProperty ( 'edgeCollections' ) ) {
1442
+ node . options . edgeCollections . forEach ( function ( ecn ) {
1443
+ e . push ( collection ( ecn ) ) ;
1444
+ eNames . push ( ecn ) ;
1445
+ } ) ;
1446
+ } else {
1447
+ edgeCols = node . graph || [ ] ;
1448
+ edgeCols . forEach ( function ( ecn ) {
1449
+ e . push ( collection ( ecn ) ) ;
1450
+ eNames . push ( ecn ) ;
1451
+ } ) ;
1452
+ }
1395
1453
node . edgeCollectionNameStr = e . join ( ', ' ) ;
1396
- node . edgeCollectionNameStrLen = edgeCols . join ( ', ' ) . length ;
1454
+ node . edgeCollectionNameStrLen = eNames . join ( ', ' ) . length ;
1397
1455
node . graph = '<anonymous>' ;
1456
+ if ( node . hasOwnProperty ( 'options' ) && node . options . hasOwnProperty ( 'vertexCollections' ) ) {
1457
+ v = [ ] ;
1458
+ node . options . vertexCollections . forEach ( function ( vcn ) {
1459
+ v . push ( collection ( vcn ) ) ;
1460
+ } ) ;
1461
+ node . vertexCollectionNameStr = v . join ( ', ' ) ;
1462
+ node . vertexCollectionNameStrLen = node . options . vertexCollections . join ( ', ' ) . length ;
1463
+ }
1398
1464
}
1399
1465
return rc ;
1400
1466
}
@@ -1445,27 +1511,61 @@ function processQuery(query, explain, planIndex) {
1445
1511
1446
1512
kShortestPathsDetails . push ( node ) ;
1447
1513
e = [ ] ;
1514
+ eNames = [ ] ;
1448
1515
if ( node . hasOwnProperty ( 'graphDefinition' ) ) {
1449
1516
v = [ ] ;
1450
- node . graphDefinition . vertexCollectionNames . forEach ( function ( vcn ) {
1451
- v . push ( collection ( vcn ) ) ;
1452
- } ) ;
1517
+ vNames = [ ] ;
1518
+ if ( node . hasOwnProperty ( 'options' ) && node . options . hasOwnProperty ( 'vertexCollections' ) ) {
1519
+ node . options . vertexCollections . forEach ( function ( vcn ) {
1520
+ v . push ( collection ( vcn ) ) ;
1521
+ vNames . push ( vcn ) ;
1522
+ } ) ;
1523
+ } else {
1524
+ node . graphDefinition . vertexCollectionNames . forEach ( function ( vcn ) {
1525
+ v . push ( collection ( vcn ) ) ;
1526
+ vNames . push ( vcn ) ;
1527
+ } ) ;
1528
+ }
1453
1529
node . vertexCollectionNameStr = v . join ( ', ' ) ;
1454
- node . vertexCollectionNameStrLen = node . graphDefinition . vertexCollectionNames . join ( ', ' ) . length ;
1530
+ node . vertexCollectionNameStrLen = vNames . join ( ', ' ) . length ;
1455
1531
1456
- node . graphDefinition . edgeCollectionNames . forEach ( function ( ecn ) {
1457
- e . push ( collection ( ecn ) ) ;
1458
- } ) ;
1532
+ if ( node . hasOwnProperty ( 'options' ) && node . options . hasOwnProperty ( 'edgeCollections' ) ) {
1533
+ node . options . edgeCollections . forEach ( function ( ecn ) {
1534
+ e . push ( collection ( ecn ) ) ;
1535
+ eNames . push ( ecn ) ;
1536
+ } ) ;
1537
+ } else {
1538
+ node . graphDefinition . edgeCollectionNames . forEach ( function ( ecn ) {
1539
+ e . push ( collection ( ecn ) ) ;
1540
+ eNames . push ( ecn ) ;
1541
+ } ) ;
1542
+ }
1459
1543
node . edgeCollectionNameStr = e . join ( ', ' ) ;
1460
- node . edgeCollectionNameStrLen = node . graphDefinition . edgeCollectionNames . join ( ', ' ) . length ;
1544
+ node . edgeCollectionNameStrLen = eNames . join ( ', ' ) . length ;
1461
1545
} else {
1462
- edgeCols = node . graph || [ ] ;
1463
- edgeCols . forEach ( function ( ecn ) {
1464
- e . push ( collection ( ecn ) ) ;
1465
- } ) ;
1546
+ if ( node . hasOwnProperty ( 'options' ) && node . options . hasOwnProperty ( 'edgeCollections' ) ) {
1547
+ node . options . edgeCollections . forEach ( function ( ecn ) {
1548
+ e . push ( collection ( ecn ) ) ;
1549
+ eNames . push ( ecn ) ;
1550
+ } ) ;
1551
+ } else {
1552
+ edgeCols = node . graph || [ ] ;
1553
+ edgeCols . forEach ( function ( ecn ) {
1554
+ e . push ( collection ( ecn ) ) ;
1555
+ eNames . push ( ecn ) ;
1556
+ } ) ;
1557
+ }
1466
1558
node . edgeCollectionNameStr = e . join ( ', ' ) ;
1467
- node . edgeCollectionNameStrLen = edgeCols . join ( ', ' ) . length ;
1559
+ node . edgeCollectionNameStrLen = eNames . join ( ', ' ) . length ;
1468
1560
node . graph = '<anonymous>' ;
1561
+ if ( node . hasOwnProperty ( 'options' ) && node . options . hasOwnProperty ( 'vertexCollections' ) ) {
1562
+ v = [ ] ;
1563
+ node . options . vertexCollections . forEach ( function ( vcn ) {
1564
+ v . push ( collection ( vcn ) ) ;
1565
+ } ) ;
1566
+ node . vertexCollectionNameStr = v . join ( ', ' ) ;
1567
+ node . vertexCollectionNameStrLen = node . options . vertexCollections . join ( ', ' ) . length ;
1568
+ }
1469
1569
}
1470
1570
return rc ;
1471
1571
}
0 commit comments