1.1.13 • Published 11 months ago

happn-db-provider-mongo v1.1.13

Weekly downloads
-
License
-
Repository
github
Last release
11 months 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
1.1.13

11 months ago

1.1.12

1 year ago

1.1.11

2 years ago

1.1.10

2 years ago

1.1.9

2 years ago

1.1.8

2 years ago

1.1.7

2 years ago

1.1.6

2 years ago

1.1.5

2 years ago

1.1.1

3 years ago

1.1.0

3 years ago

1.0.17

3 years ago

1.1.4

2 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.0.16

3 years ago

1.0.15

3 years ago

1.0.14

3 years ago

1.0.13

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.11

3 years ago

1.0.10

3 years ago

1.0.12

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.2

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago