
Research
Security News
The Growing Risk of Malicious Browser Extensions
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
mongodb-aggregate-builder
Advanced tools
This library developed on Typescript.
The MongoDB Aggregate Builder is a powerful tool designed to simplify the process of creating and managing aggregate rules in an object-oriented programming paradigm. An aggregate rule is a rule that operates on a collection of objects or entities rather than individual ones, allowing for efficient and cohesive processing of data.
This library provides a comprehensive set of features and abstractions to define and manipulate aggregate rules. It encourages encapsulation, modularization, and reusability, promoting clean and maintainable code. With this library, developers can easily create, compose, and apply aggregate rules in their applications without the need for extensive boilerplate code.
In summary, the MongoDB Aggregate Builder empowers developers to design, manage, and apply aggregate rules in an object-oriented programming style. It promotes code reuse, extensibility, and maintainability, making it an invaluable tool for applications that deal with complex rule-based operations on collections of objects or entities.
Run next command
npm i mongodb-aggregate-builder
import {AggregateBuilder, andExpr, SortDirection, toString} from 'mongodb-aggregate-builder';
const aggBuilder = new AggregateBuilder();
aggBuilder
.match(andExpr([{name: 'John'}, {age: {$gt: 18}}]))
.addFields(toString('age', 'stringAge'))
.sort({age: SortDirection.ASC_TEXT}).skip(10).limit(5);
console.log(JSON.stringify(aggBuilder.build(), null, 2));
[
{
"$match": {
"$and": [
{
"name": "John"
},
{
"age": {
"$gt": 18
}
}
]
}
},
{
"$addFields": {
"stringAge": {
"$toString": "$age"
}
}
}
]
MIT
FAQs
Builder for generate aggregation query for MongoDB
The npm package mongodb-aggregate-builder receives a total of 87 weekly downloads. As such, mongodb-aggregate-builder popularity was classified as not popular.
We found that mongodb-aggregate-builder demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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.
Research
Security News
Socket researchers uncover how browser extensions in trusted stores are used to hijack sessions, redirect traffic, and manipulate user behavior.
Research
Security News
An in-depth analysis of credential stealers, crypto drainers, cryptojackers, and clipboard hijackers abusing open source package registries to compromise Web3 development environments.
Security News
pnpm 10.12.1 introduces a global virtual store for faster installs and new options for managing dependencies with version catalogs.