Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
@qp-mongosh/autocomplete
Advanced tools
@qp-mongosh/autocomplete
Package for MongoDB Shell
const autocomplete = require('@qp-mongosh/autocomplete');
const serverVersion = '4.4.0';
const line = 'db.coll.fin';
const completions = autocomplete(serverVersion, line);
if (!completions || !completions.length) {
return [];
}
const entries = completions[0].map((completion) => {
return {
completion
};
});
serverVersion: current version of MongoDB line: current line to autcomplete
Returns an array of completions, and the line we were autocompleting. For example:
const autocomplete = require('@qp-mongosh/autocomplete');
const serverVersion = '4.4.0';
const line = 'db.coll.re';
const completions = autocomplete(serverVersion, line);
// returns:
// [
// [ 'db.coll.renameCollection', 'db.coll.replaceOne', 'db.coll.reIndex' ],
// 'db.coll.re'
// ]
Autocomplete is based on currently implemeted APIs in @qp-mongosh/shell-api
npm install -S @qp-mongosh/errors
FAQs
MongoDB Shell Autocomplete Package
We found that @qp-mongosh/autocomplete demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 6 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
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.