Crud with mongoDb-native and RBAC role/permission for AWS Lambdas
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
lib
tests
.gitignore
.travis.yml
LICENSE
README.md
index.js
package-lock.json
package.json

README.md

lambda mongo crud

Build Status

Crud with mongoDb-native and RBAC role/permission for AWS Lambdas

Installation

npm install @palmabit/lambda-mongo-crud --save

Usage

const Crud = require('@palmabit/lambda-mongo-crud')

const roles = {
    base: {
        can: ['posts:list','posts:get']
    },
    admin: {
        can: ['posts:save','posts:delete']
    }
}

const crud = new Crud('stringConnection','tableName','admin',roles)

const query = {}
const roleOptions = {}

crud.list(query,'posts:list',roleOptions, (err,docs) => {} )

Tests

npm test

Coverage

npm run-script test-travis

Author

Palmabit

License

MIT license