function name(node) {
for (var Prop in LabelMap) {
if (LabelMap.hasOwnProperty(Prop) && labels(node).includes(Prop)) {
return node.properties[LabelMap[Prop]];
}
}
var x = ["^name$","^title$","^label$","value","name$","title$","label$",""];
var props = node.properties;
for (var i=0;i<x.length;i++) {
for (let k in props) {
if (props.hasOwnProperty(k) && k.toLowerCase().match(x[i])) return props[k];
}
}
return node.identity.toString();
}
Not sure what the best route would be to expose this (e.g. in PowerShell I might simply allow a hashtable param so someone could just specify -LabelMap @{User='ADSamAccountName';Service='name'}). Just going to keep things hard coded on our side for now, given that this seems a bit inactive
Hi!
I'm a bit of a neo4j and javascript newbie, so apologies if this doesn't make sense.
It might be handy to allow a user-specific map of label(s) to property, so that titles make sense for a particular database.
Absolutely not how you would implement it, but for example, we're using a hard coded bit like this:
Not sure what the best route would be to expose this (e.g. in PowerShell I might simply allow a hashtable param so someone could just specify
-LabelMap @{User='ADSamAccountName';Service='name'}
). Just going to keep things hard coded on our side for now, given that this seems a bit inactiveCheers!