How to use the node-red-contrib-viseo-nosql-manager.dbRegistry.values function in node-red-contrib-viseo-nosql-manager

To help you get started, we’ve selected a few node-red-contrib-viseo-nosql-manager 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 NGRP / node-red-contrib-viseo / node-red-contrib-nosql / node-handover.js View on Github external
const register = function(config) {
        RED.nodes.createNode(this, config);
        var node = this;
        
        node.status({});    


        //select the config node depending on config
        let selectorFactory = new DbSelectorFactory();
        let selector = selectorFactory.create(config, databaseRegistry.values);
        if(!selector) {
            return node.status({ fill: "red", shape: "dot", text: "Database type '"+config["server-type"]+"' is not defined" });
        }

        this.server = RED.nodes.getNode(selector.config);

        //the config node can't be found in the flow
        if(!this.server) {
            return node.status({ fill: "red", shape: "dot", text: "Database configuration missing" });
        }

        //the config node is incomplete and doesn't define a database manager
        if(this.server.databaseManager === undefined || this.server.databaseManager instanceof DatabaseManager === false) {
            node.error("Database Manager for "+config.type+" must be set.");
        }
github NGRP / node-red-contrib-viseo / node-red-contrib-nosql / node-nosql.js View on Github external
const register = function(config) {
        RED.nodes.createNode(this, config);
        var node = this;
        
        node.status({});    


        //select the config node depending on config
        let selectorFactory = new DbSelectorFactory();
        let selector = selectorFactory.create(config, databaseRegistry.values);
        if(!selector) {
            return node.status({ fill: "red", shape: "dot", text: "Database type '"+config["server-type"]+"' is not defined" });
        }

        this.server = RED.nodes.getNode(selector.config);

        //the config node can't be found in the flow
        if(!this.server) {
            return node.status({ fill: "red", shape: "dot", text: "Database configuration missing" });
        }

        //the config node is incomplete and doesn't define a database manager
        if(this.server.databaseManager === undefined || this.server.databaseManager instanceof DatabaseManager === false) {
            node.error("Database Manager for "+config.type+" must be set.");
        }