Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
enmap-mongo
Advanced tools
Enmap-Mongo is a provider for the Enmap module.
To install Enmap-Mongo simply run npm i enmap-mongo
.
// Load Enmap
const Enmap = require('enmap');
// Load EnmapMongo
const EnmapMongo = require('enmap-mongo');
// Initialize the provider
const Provider = new EnmapMongo({ name: 'test' });
// Initialize the Enmap with the provider instance.
const myColl = new Enmap({ provider: provider });
Shorthand declaration:
const Enmap = require('enmap');
const EnmapMongo = require('enmap-mongo');
const myColl = new Enmap({ provider: new EnmapMongo({ name: 'test' }); });
// Example with all options.
const level = new EnmapMongo({
name: 'test',
dbName: 'enmap',
user: 'username',
pass: 'password',
host: 'localhost',
port: 27017
});
// Example with full URL.
const level = new EnmapMongo({
name: 'test',
dbName: 'enmap',
url: 'mongodb://username:password@localhost:27017/enmap'
});
The name
option is mandatory and defines the name of the collection where the data is stored.
The dbName
is optional and defines the database where data is stored. If multiple enmap instances connect to the same database, the same database is used with different table collections. The default database is enmap
.
The host
is optional and defines which host this module attempts to connect to. The default host is localhost
.
The port
is optional and defines which port is used to connect to the Rethink DB. The default port is 27017
.
Optional, used for authentication. Needs both to work, or neither.
Optional. If used, the host
, port
, user
and pass
options are ignored , and url
is used instead. Note that the /dbname
at the end of your url must correspond to the dbName
value (or enmap
).
FAQs
A MongoDB provider for Enmap
The npm package enmap-mongo receives a total of 23 weekly downloads. As such, enmap-mongo popularity was classified as not popular.
We found that enmap-mongo 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.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.