Security News
Cloudflare Adds Security.txt Setup Wizard
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
mongo-graph
Advanced tools
Visualizes connections between documents in a mongo database.
npm install mongo-graph -g
You also need GraphViz. On a Mac with homebrew you can brew install graphviz
.
mongo test-db --quiet --eval 'db.foo.remove(); db.foo.insert([
{
"_id" : ObjectId("000000000000000000000001"),
"other_foo" : ObjectId("000000000000000000000002")
},
{
"_id" : ObjectId("000000000000000000000002"),
"other_foo" : ObjectId("000000000000000000000001")
}])'
mongoexport --db test-db --collection foo | mongo-graph | dot -Tpng -o out.png && open out.png
Data in a db often has links between documents in different collections. The output of mongoexport
contains no data about the associated collection. However, mongo-graph can interpret a __collection
field as metadata about which collection the json object belongs to. You can do this at the db level, or use a handy command-line json modifier like jsontool:
mongo test-db --quiet --eval 'db.foo.remove(); db.foo.insert([
{
"_id" : ObjectId("000000000000000000000001"),
"bar" : ObjectId("000000000000000000000003")
},
{
"_id" : ObjectId("000000000000000000000002"),
"bar" : ObjectId("000000000000000000000004")
}])'
mongo test-db --quiet --eval 'db.bar.remove(); db.bar.insert([
{
"_id" : ObjectId("000000000000000000000003"),
},
{
"_id" : ObjectId("000000000000000000000004"),
}])'
mongoexport --jsonArray --db test-db --collection foo | json -e 'this.__collection="foo"' > foo.in
mongoexport --jsonArray --db test-db --collection bar | json -e 'this.__collection="bar"' > bar.in
cat foo.in bar.in | mongo-graph | dot -Tpng -o out.png && open out.png
Labeling nodes by ObjectId is not very useful. You can override this default by attaching a __label
field to your json objects:
mongo test-db --quiet --eval 'db.foo.remove(); db.foo.insert([
{
"_id" : ObjectId("000000000000000000000001"),
"bar" : ObjectId("000000000000000000000003"),
"human_readable": "1"
},
{
"_id" : ObjectId("000000000000000000000002"),
"bar" : ObjectId("000000000000000000000004"),
"human_readable": "2"
}])'
mongo test-db --quiet --eval 'db.bar.remove(); db.bar.insert([
{
"_id" : ObjectId("000000000000000000000003"),
"human_readable": "3"
},
{
"_id" : ObjectId("000000000000000000000004"),
"human_readable": "4"
}])'
mongoexport --jsonArray --db test-db --collection foo | json -e 'this.__collection="foo"; this.__label=this.human_readable' > foo.in
mongoexport --jsonArray --db test-db --collection bar | json -e 'this.__collection="bar"; this.__label=this.human_readable' > bar.in
cat foo.in bar.in | mongo-graph | dot -Tpng -o out.png && open out.png
FAQs
visualize mongo data
The npm package mongo-graph receives a total of 2 weekly downloads. As such, mongo-graph popularity was classified as not popular.
We found that mongo-graph 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
Cloudflare has launched a setup wizard allowing users to easily create and manage a security.txt file for vulnerability disclosure on their websites.
Security News
The Socket Research team breaks down a malicious npm package targeting the legitimate DOMPurify library. It uses obfuscated code to hide that it is exfiltrating browser and crypto wallet data.
Security News
ENISA’s 2024 report highlights the EU’s top cybersecurity threats, including rising DDoS attacks, ransomware, supply chain vulnerabilities, and weaponized AI.