4.0.1 • Published 3 years ago

happn-service-mongo-2 v4.0.1

Weekly downloads
81
License
-
Repository
github
Last release
3 years ago

npm Build Status Coverage Status David

Introduction

installing mongo and redis on your local machine - for testing:

# mongo latest
docker pull mongo

docker run -p 27017:27017 -d mongo

# redis
docker pull redis

docker run -p 6379:6379 -d redis

Two configuration options:

config = {
  // name of collection where happn/happner stores data
  collection: 'collectioName',
  
  // database housing the collection
  url: 'mongodb://127.0.0.1:27017/databaseName'
}

Getting started

Using this plugin from happner.

npm install happner happn-service-mongo --save

See happner for full complement of config.

var Happner = require('happner');

var config = {
  happn: {
    plugin: 'happn-service-mongo',
    config: {
      collection: 'happner',
      url: 'mongodb://127.0.0.1:27017/happner'
    }
  }
};

Happner.create(config)

  .then(function(server) {
    // ...
  })

  .catch(function(error) {
    console.error(error.stack);
    process.exit(1);
  });

Using this plugin from happn.

npm install happn happn-service-mongo --save

See happn for full complement of config.

var Happn = require('happn');

var config = {
  services: {
    data: {
      path: 'happn-service-mongo',
      config: {
        collection: 'happn',
        url: 'mongodb://127.0.0.1:27017/happn'
      }
    }
  }
};

Happn.service.create(config)

  .then(function(server) {
    //...
  })

  .catch(function(error) {
    console.error(error.stack);
    process.exit(1);
  });

##release 0.1.0

  • ability to partition db's and collections by path
  • allow for update or findAndModify depending on options
  • embedded LRU cache, that can use redis pubsub to share state around
4.0.1

3 years ago

4.0.0

3 years ago

3.1.2

3 years ago

3.1.1

3 years ago

3.1.0

3 years ago

3.0.0

5 years ago

2.2.0

5 years ago

2.1.1

6 years ago

2.1.0

6 years ago

2.0.0

6 years ago

2.0.0-alpha.3

6 years ago

2.0.0-alpha.2

6 years ago

2.0.0-alpha.1

6 years ago

1.2.0

7 years ago

1.1.0

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago

0.1.0

7 years ago

0.0.2

7 years ago

0.0.1

8 years ago