
Research
SANDWORM_MODE: Shai-Hulud-Style npm Worm Hijacks CI Workflows and Poisons AI Toolchains
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.
CLI tool to index MongoDB collections
Install the package globally or alternatively you can also use npx
npm install -g mondex
Create a JSON file containing the index definitions. The file should be an array of objects with the two properties:
collection: Name of the collectionindexes: Array of indexes to be createdIndex format is same as the one you would pass to db.collection.createIndex() in the mongo shell.
Given below is a sample JSON file representing sample index configuration:
[
{
collection: "user",
indexes: [
{ email: -1 },
{ verificationCode: -1 },
{ resetPasswordCode: -1 },
{ createdAt: -1 },
],
},
{
collection: "resources",
indexes: [{ resourceId: -1, resourceType: -1 }],
},
];
Once you have the JSON file ready, you can use the mondex to start managing your indexes.
Here is the list of mondex commands that you can use
pull — lets you create index configuration file by pulling existing indexes from your databaseplan — shows the indexes to be created or droppedapply — applies the changes from the configuration file (i.e. apply or drop indexes)The list of options accepted by mondex are
Usage: mondex <command> [options]
Commands:
pull Creates index configuration from database
plan Shows the index changes to be applied to database
apply Applies the index changes from configuration to database
Options:
-V, --version output the version number
-h, --help display help for command
-f, --file <file> path to indexes file (defaults to indexes.json in current directory)
-i --uri <uri> connection string for MongoDB
-d, --database <database> database name
Show the indexes that will be created and dropped
mondex --uri mongodb://localhost:27017 --database mydb --file ./indexes.json
mondex --uri mongodb://localhost:27017 --database mydb --file ./indexes.json --plan
Apply the changes from index configuration
mondex --uri mongodb://localhost:27017 --database mydb --file ./indexes.json --apply
MIT © Kamran Ahmed
FAQs
CLI to index MongoDB collections
We found that mondex 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
An emerging npm supply chain attack that infects repos, steals CI secrets, and targets developer AI toolchains for further compromise.

Company News
Socket is proud to join the OpenJS Foundation as a Silver Member, deepening our commitment to the long-term health and security of the JavaScript ecosystem.

Security News
npm now links to Socket's security analysis on every package page. Here's what you'll find when you click through.