🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

ew-action-mongodb

Package Overview
Dependencies
Maintainers
4
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ew-action-mongodb - npm Package Compare versions

Comparing version

to
0.1.8

2

package.json
{
"name": "ew-action-mongodb",
"version": "0.1.7",
"version": "0.1.8",
"description": "Mongo Action connector for eWings framework",

@@ -5,0 +5,0 @@ "main": "src/index.js",

@@ -33,12 +33,12 @@ [![Build Status](https://travis-ci.org/Lingbe/ewActionMongo.svg?branch=master)](https://travis-ci.org/Lingbe/ewActionMongo) [![Coverage Status](https://coveralls.io/repos/github/Lingbe/ewActionMongo/badge.svg?branch=master)](https://coveralls.io/github/Lingbe/ewActionMongo?branch=master)

```
```json
{
id : 1,
status : 'request',
type : 'user/insert',
owner : 'owner',
payload: {
name : 'john doe',
age : 25,
status: 'online'
"id" : 1,
"status" : "request",
"type" : "user/insert",
"owner" : "owner",
"payload": {
"name" : "john doe",
"age" : 25,
"status": "online"
}

@@ -54,5 +54,5 @@ };

```javascript
const eventType = `${collection}/${action}/${parameter}`;
```
${collection}/${action}/${parameter}
```

@@ -72,3 +72,4 @@ Collection and action are mandatory of the event type, while parametes is option. An action can only have one of the follow values:

In order to setup the eWing Mongo Action we need a connection to mongoDB and define the model behaviour.
```
```javascript
const eWings = require('ewings');

@@ -83,3 +84,3 @@ const ewActionMongo = require('ew-action-mongodb');

const mongoAction = ewActionMongo(config);
const interfaces = []
const interfaces = [];

@@ -93,3 +94,3 @@ eWings.init(interfaces, [mongoAction]);

```
```javascript
let db:

@@ -109,6 +110,12 @@ MongoClient.connect(MongoUrlConn, (err, client) => {

```
```javascript
const models = {
user: { schema: userSchemaMock, roles: roles },
jobs: { schema: jobsSchemaMock, actions: ['find'] }
user: {
schema: userSchemaMock,
roles: roles
},
jobs: {
schema: jobsSchemaMock,
actions: ['find']
}
}

@@ -115,0 +122,0 @@ ```