
Security News
Open Source Maintainers Feeling the Weight of the EU’s Cyber Resilience Act
The EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
mongodb-pipelinejs
Advanced tools
Use short and sweet JS syntax (instead of JSON) to compose and cleanly format MongoDB aggregations.
Aggregation Syntax for Javascript; Use Javascript syntax—instead of JSON—to compose MongoDB aggregations.
Browse Reference Documentation »
Add mongodb-pipelinejs
to your MongoDB project:
With Yarn: yarn add mongodb-pipelinejs
With NPM: npm install mongodb-pipelinejs
Example needs refinement...
const $ = require('mongodb-pipelinejs');
mongoDB.collection('transactions').aggregate([
$.match({
userId: MY_USER_ID,
amount: $.gte(100),
type: $.in(['sale', 'transfer']),
status: $.neq('new'),
}),
$.redact($.switch('$$PRUNE')
.case($.eq('$type', 'sale')),
}),
$.addFields({
payments: $.filter('$payments', 'payment', $.in('$$payment.status', ['complete', 'approved'])),
}),
$.unwind('$payments'),
$.group({
_id: '$transactionId',
payments: $.push('$payments.paymentId'),
amountDue: $.last('$amount'),
amountPaid: $.sum('$payments.amount'),
})
$.unwind('$payments', true)
]).toArray();
FAQs
Use short and sweet JS syntax to compose and cleanly format MongoDB aggregations.
The npm package mongodb-pipelinejs receives a total of 11 weekly downloads. As such, mongodb-pipelinejs popularity was classified as not popular.
We found that mongodb-pipelinejs demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 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 EU Cyber Resilience Act is prompting compliance requests that open source maintainers may not be obligated or equipped to handle.
Security News
Crates.io adds Trusted Publishing support, enabling secure GitHub Actions-based crate releases without long-lived API tokens.
Research
/Security News
Undocumented protestware found in 28 npm packages disrupts UI for Russian-language users visiting Russian and Belarusian domains.