
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
@exocet/pandora-mongodb
Advanced tools
Addon to provide flow and setup functions to MongoDB persistence for Pandora.
npm install --save @exocet/pandora-mongodb
Available features:
To add this addon into your project, put the addon spec into your endpoint YAML:
kind: Pandora/endpoint
metadata:
name: myEndpoint
spec:
addons:
- name: mongodb
package: "@exocet/pandora-mongodb"
flow: true
setup: true
configuration:
mongodb: # Any configuration here will be passed to client configuration (1)
database: myDatabase
url: mongodb://localhost:27017
collections:
- entityName: myNamespace.myEntity # To create index and mapping for an entity, pass the entity name, the settings bellow are the defaults
textIndex: true
- collectionName: myCollection
textIndex: true
After the setup the following property of the context will be available:
.application.dbs.mongoClient
- The client connected to MongoDB.application.dbs.mongodb
- The connected database referenceThe hooks created by this addon are:
.service.hooks.useHook('mongodbQueryParsers')
) - Synchronous hook that parses the search AQS query into MongoDB aggregation pipeline.
const [queryParsers] = this.service.hooks.useHook('mongodbQueryParsers');
const queryParser = queryParsers(entityName);
const {
pipeline, // The aggregation pipeline
hasMatch // Boolean to indicate if the pipeline have the match operation
} = queryParser(
aqsQuery,
{ // Optional options
pipeline: [], // Existent aggregation pipeline
}
);
The provided flow type and steps are listed bellow:
kind: Pandora/flowStep
metadata:
name: entityPersistence
labels:
operation: insert
spec:
type: mongodb # Flow step type
options:
operation: insert # Defines that is an insert operation
inboundFrom: request.data # The path to the data to be inserted (acquired from execution context)
idFrom: null # If you want to use a custom ID instead of UUIDv4 you can pass the path from the execution context to get the ID value
collectionName: null # If you're using custom collection name, pass the name here
entity: # The entity to define the input parser hook
namespace: myNamespace
name: myEntity
kind: Pandora/flowStep
metadata:
name: entityPersistence
labels:
operation: exists
spec:
type: mongodb
options:
operation: exists
idFrom: request.data.id # The path of the ID
outboundTo: null # The execution path of the context to put the found ID, is an useful flow step to put before update and delete flows to get the native ID before operating the entity
collectionName: null
entity:
namespace: myNamespace
name: myEntity
kind: Pandora/flowStep
metadata:
name: entityPersistence
labels:
operation: update
spec:
type: mongodb
options:
operation: update
inboundFrom: request.data
idFrom: request.data.id # The path of the ID to update entity
collectionName: null
entity:
namespace: myNamespace
name: myEntity
kind: Pandora/flowStep
metadata:
name: entityPersistence
labels:
operation: delete
spec:
type: mongodb
options:
operation: delete
idFrom: request.data.id
collectionName: null
entity:
namespace: myNamespace
name: myEntity
kind: Pandora/flowStep
metadata:
name: entityPersistence
labels:
operation: search
spec:
type: mongodb
options:
operation: search
queryFrom: request.query # The execution context path that have the AQS querystring
outboundTo: response # The execution context path to put the search result
pipelineFrom: null # The execution context path that have an existing pipeline instance to append the parsed AQS filters, pass null to indicate the flow step to generate a new instance
collectionName: null
entity:
namespace: myNamespace
name: myEntity
FAQs
Pandora MongoDB persistence addon
We found that @exocet/pandora-mongodb demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.