Hello, I was wondering if there was a native way with the driver to return a list of nodes, rather than looping through the data and flattening it out myself. There are also unneeded fields such as identity and labels for me.
I could simply do result.records[0]["_fields"][0].map( x => x.properties);
But was hoping I could learn another way directly from either the driver or db.
E.x.
Query: CALL db.index.fulltext.queryNodes("myIndex", $search_query) YIELD node, score RETURN COLLECT(node) LIMIT $limit
Return data from query:
{
"records": [
{
"keys": [
"COLLECT(node)"
],
"length": 1,
"_fields": [
[
{ "identity": {
"low": 100,
"high": 0
},
"labels": [
"somelabel"
],
"properties": {
"keys": "Values",
.
.
.
.
}
},
{ "identity": {
"low": 100,
"high": 0
},
"labels": [
"somelabel"
],
"properties": {
"keys": "Values",
.
.
.
.
}
}
.
.
}]]
What I expect is simply an array of objects that only contain the properties, e.g. [{"key","value"....},{"key":"value",....}...]
If not I can write my own method, but this seems like a fairly common use case but I can't find ways to perhaps modify the query or driver to do what I need.
I'm using version 4.0.2 of the driver.