
Security News
Research
Destructive npm Packages Disguised as Utilities Enable Remote System Wipe
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Supply Chain Security
Vulnerability
Quality
Maintenance
License
Mongodb Object Document Mapper
var modm = require("modm");
// define a schema
var schema = new modm.Schema({field: String});
// create db connection
var model = modm("myDb", {
host: "127.0.0.1",
port: 27017,
server: {pooSize: 5},
db: {w: 1}
});
// get a collection
var myCollection = model("myCollection", schema);
// db operations
myCollection.insert({data: 1}, function (err, item) {
//...
});
// connect first, otherwise find will return undefined
// instead of a cursor.
model.connect(function (err, db) {
var cursor = myCollection.find({/*query*/});
cursor.toArray(function () {
//...
});
});
// ..or access the cursor in the callback
myCollection.find({/*query*/}, function (err, cursor) {
cursor.toArray(function () {
//...
});
});
Results of atomic operations are not validated.
Name | Example | Description |
---|---|---|
type | "string" | Possible values: "Array" , "Boolean" , "Buffer" , "Date" , "Number" , "Object" , "ObjectID" |
required | true | Possible values: true , false |
default | "this is a string default value" | The default value. Can by any type of data. |
validate | function () {} | Validate function |
manipulate | function () {} | Manipulate function |
pre | "my prefix " | A string to prefix the value |
post | " my suffix" | A string to suffix the value |
charStyle | "normal" | Possible values: "normal" , "uppercase" , "lowercase" |
parse | DD.MM.YYY | For `date` types only. A string value passed if available to the Moment.js date parser. |
trim | true | Boolean value. Trim or not? |
maxLength | 5 | Max length. Integer. |
minLength | 1 | Min length. Integer. |
max | 5 | number |
min | -3 | number |
live | true | Boolean value: true or false . Not yet implemented |
"THE BEER-WARE LICENSE" (Revision 42):
adrian@ottiker.com wrote this code. As long as you retain this notice you can do whatever you want with this stuff. If we meet some day, and you think this stuff is worth it, you can buy me a beer in return.
FAQs
A MongoDB Object Document Mapper (ODM)
The npm package modm receives a total of 7 weekly downloads. As such, modm popularity was classified as not popular.
We found that modm demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
Research
Socket uncovered two npm packages that register hidden HTTP endpoints to delete all files on command.
Research
Security News
Malicious Ruby gems typosquat Fastlane plugins to steal Telegram bot tokens, messages, and files, exploiting demand after Vietnam’s Telegram ban.
Research
Security News
Socket uncovered four malicious npm packages that exfiltrate up to 85% of a victim’s Ethereum or BSC wallet using obfuscated JavaScript.