1.1.12 • Published 2 days ago

happn-db-provider-mongo v1.1.12

Weekly downloads
-
License
-
Repository
github
Last release
2 days 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.12

1 month ago

1.1.11

9 months ago

1.1.10

12 months ago

1.1.9

1 year ago

1.1.8

1 year ago

1.1.7

1 year ago

1.1.6

1 year ago

1.1.5

1 year ago

1.1.1

2 years ago

1.1.0

2 years ago

1.0.17

2 years ago

1.1.4

1 year ago

1.1.3

1 year ago

1.1.2

1 year ago

1.0.16

2 years ago

1.0.15

2 years ago

1.0.14

2 years ago

1.0.13

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.11

2 years ago

1.0.10

2 years ago

1.0.12

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.2

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago