Skip to content

Latest commit

 

History

History
executable file
·
53 lines (35 loc) · 847 Bytes

README.md

File metadata and controls

executable file
·
53 lines (35 loc) · 847 Bytes

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