sss-mongo-redis

0.1.2 • Public • Published

Super Scaled Sockets - The Mongo Redis Super Scaler

This is the Mongo Redis Scaler for the Super Scaled Sockets Library.

Prerequisites

A mongoDb database and credentials

A redis instance and credentials

MongoDB Atlas: https://www.mongodb.com

RedisLabs: https://redislabs.com/

Installation

On nmp run the following command:

npm install sss-mongo-redis

Usage

const sss = require('super-scaled-sockets');
const mongoRedis = require('sss-mongo-redis');

// mongo connection info all properties are required
const mongoConnection = {
  uri: 'mongodb+srv://smartUsername:smartPassword@cluster0-abcd.zyx.mongodb.net/test?retryWrites=true',
  dbName: 'redis',
  collectionName: 'redis'
};

// redis connection Info all properties are required
const redisConnection = {
  password: 'ABCDefGH1234567890ZYXWvu',
  host: 'redis-123456.z9.us-east-1-0.ec2.cloud.redislabs.com',
  port: 123456
};

mongoRedis.connect(mongoConnection, redisConnection, (err, scaler) => {
  if (err) {
    console.log('Error establishing scaler connection');
    return;
  }
  const client = sss.client(scaler, {})
  client.connect((error) => {
    // ......

For details about setting up the rest of Super Scaled Sockets please see the Super Scaled Sockets Page.

Readme

Keywords

none

Package Sidebar

Install

npm i sss-mongo-redis

Weekly Downloads

0

Version

0.1.2

License

MIT

Unpacked Size

8.56 kB

Total Files

6

Last publish

Collaborators

  • jazzbrown1