Research
Security News
Malicious npm Packages Inject SSH Backdoors via Typosquatted Libraries
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
mongoose-embedded-document
Advanced tools
A Mongoose plugin to provide support for embedding single documents.
A Mongoose plugin to provide support for embedding single documents.
npm install mongoose-embedded-document
var embeddedDoc = require 'mongoose-embedded-document
embeddedSchema = new mongoose.Schema name: String
Embedded = mongoose.model('Embedded', embeddedSchema)
schema = new mongoose.Schema deep: {}
schema.plugin embeddedDoc, path: 'embedded', ref: 'Embedded', required: true
schema.plugin embeddedDoc, path: 'deep.embedded', ref: 'Embedded'
Parent = mongoose.model('Parent', schema)
parent = new Parent embedded: new Embedded(name: 'My Name')
parent.deep.embedded = new Embedded(name: 'My Deep Name')
console.log parent.embedded.name # Logs 'My Name'
console.log parent.deep.embedded.name # Logs 'My Deep Name'
This plugin uses Schema.Types.Mixed
for the type of the embedded document. This means that the parent schema does not
know the types of the attributes of the embedded document. This can be an issue when you are used to relying on
Mongoose's type casting in queries for attributes of type ObjectId
and Date
in particular.
Please follow our Code of Conduct when contributing to this project.
$ git clone https://github.com/goodeggs/mongoose-embedded-document && cd mongoose-embedded-document
$ npm install
$ npm test
Module scaffold generated by generator-goodeggs-npm.
FAQs
A Mongoose plugin to provide support for embedding single documents.
We found that mongoose-embedded-document demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 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.
Research
Security News
Socket’s threat research team has detected six malicious npm packages typosquatting popular libraries to insert SSH backdoors.
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.