How to use the loopback-connector.ModelKeyComposer function in loopback-connector

To help you get started, we’ve selected a few loopback-connector 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 strongloop / loopback-connector-kv-redis / lib / kv-redis.js View on Github external
// Copyright IBM Corp. 2016,2018. All Rights Reserved.
// Node module: loopback-connector-kv-redis
// This file is licensed under the MIT License.
// License text available at https://opensource.org/licenses/MIT

'use strict';

const SG = require('strong-globalize');
SG.SetRootDir(__dirname + '/..');
const g = SG();

const assert = require('assert');
const connectorCore = require('loopback-connector');
const Connector = connectorCore.Connector;
const ModelKeyComposer = connectorCore.ModelKeyComposer;
const BinaryPacker = connectorCore.BinaryPacker;
const JSONStringPacker = connectorCore.JSONStringPacker;
const debug = require('debug')('loopback:connector:kv-redis');
const Redis = require('ioredis');
const util = require('util');

/**
 * @module loopback-connector-kv-redis
 *
 * Initialize the KeyValue Redis connector against the given data source.
 *
 * @param {DataSource} dataSource The `loopback-datasource-juggler` dataSource.
 * @callback {Function} callback
 * @param {Error} err Error Object.
 *
 * @header RedisKeyValueConnector.initialize(dataSource, cb)