How to use the neo4j-driver.v1.integer function in neo4j-driver

To help you get started, we’ve selected a few neo4j-driver examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github OriginTrail / ot-node / modules / Database / Neo4j.js View on Github external
static _transformProperty(property) {
        if (neo4j.isInt(property)) {
            if (neo4j.integer.inSafeRange(property)) {
                return property.toNumber();
            }
            return property.toString();
        }
        if (Array.isArray(property)) {
            const newArray = [];
            for (const item of property) {
                newArray.push(Neo4jDB._transformProperty(item));
            }
            return newArray;
        }
        return property;
    }
github jamesfer / cypher-query-builder / src / transformer.ts View on Github external
private transformRelation(rel: NeoRelation): Relation {
    return {
      identity: neo4j.integer.toString(rel.identity),
      start: neo4j.integer.toString(rel.start),
      end: neo4j.integer.toString(rel.end),
      label: rel.type,
      properties: mapValues(rel.properties, this.transformValue.bind(this)),
    };
  }
github jamesfer / cypher-query-builder / src / transformer.ts View on Github external
private convertInteger(num: Integer) {
    if (neo4j.integer.inSafeRange(num)) {
      return neo4j.integer.toNumber(num);
    }
    return neo4j.integer.toString(num);
  }
}
github al66 / imicros-flow / lib / connector / neo4j.js View on Github external
transform(object) {
        for (let property in object) {
            if (object.hasOwnProperty(property)) {
                const propertyValue = object[property];
                if (db.isInt(propertyValue)) {
                    if (db.integer.inSafeRange(propertyValue)) {
                        object[property] = propertyValue.toNumber();
                    } else {
                        object[property] = propertyValue.toString();
                    }
                } else if (typeof propertyValue === "object") {
                    this.transform(propertyValue);
                }
            }
        }
    }