neo4j-rstats / neo4r

A Modern and Flexible Neo4J Driver
https://neo4j-rstats.github.io/user-guide/
Other
106 stars 29 forks source link

[Question] Should the include_stats argument of call_api be TRUE by default? #27

Open ColinFay opened 6 years ago

ColinFay commented 6 years ago

The include_stats argument of the call_api function is now FALSE by default.

It returns the stats about the actions performed by the call, e.g. :

# A tibble: 12 x 2
   type                  value
   <chr>                 <dbl>
 1 contains_updates         1.
 2 nodes_created         1021.
 3 nodes_deleted            0.
 4 properties_set        1021.
 5 relationships_created    0.
 6 relationship_deleted     0.
 7 labels_added          1021.
 8 labels_removed           0.
 9 indexes_added            0.
10 indexes_removed          0.
11 constraints_added        0.
12 constraints_removed      0.

It would make sense that it is always returned when called on a CREATE / MERGE (just as above), but would it be less practical to have it to TRUE by default when we are querying data :

'MATCH (u:User) RETURN COUNT(u) AS Users_count' %>%
  call_api(con, include_stats = TRUE)
$Users_count
# A tibble: 1 x 1
  value
  <int>
1  1021

$stats
# A tibble: 12 x 2
   type                  value
   <chr>                 <dbl>
 1 contains_updates         0.
 2 nodes_created            0.
 3 nodes_deleted            0.
 4 properties_set           0.
 5 relationships_created    0.
 6 relationship_deleted     0.
 7 labels_added             0.
 8 labels_removed           0.
 9 indexes_added            0.
10 indexes_removed          0.
11 constraints_added        0.
12 constraints_removed      0.