Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
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 3 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
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.