
Security News
MCP Community Begins Work on Official MCP Metaregistry
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
@mongosh/snippet-analyze-schema
Advanced tools
Analyze the schema of a collection or a cursor.
> schema(db.coll);
┌─────────┬───────┬───────────┬────────────┐
│ (index) │ 0 │ 1 │ 2 │
├─────────┼───────┼───────────┼────────────┤
│ 0 │ '_id' │ '100.0 %' │ 'ObjectID' │
│ 1 │ 'a ' │ '50.0 %' │ 'Number' │
│ 2 │ 'a ' │ '50.0 %' │ 'String' │
└─────────┴───────┴───────────┴────────────┘
> schema(db.coll.find({ }));
┌─────────┬───────┬───────────┬────────────┐
│ (index) │ 0 │ 1 │ 2 │
├─────────┼───────┼───────────┼────────────┤
│ 0 │ '_id' │ '100.0 %' │ 'ObjectID' │
│ 1 │ 'a ' │ '100.0 %' │ 'Number' │
└─────────┴───────┴───────────┴────────────┘
> schema(db.test.aggregate([{ $group: { _id: null, count: { $sum: 1 } } }]));
┌─────────┬─────────┬───────────┬──────────┐
│ (index) │ 0 │ 1 │ 2 │
├─────────┼─────────┼───────────┼──────────┤
│ 0 │ '_id ' │ '100.0 %' │ 'Null' │
│ 1 │ 'count' │ '100.0 %' │ 'Number' │
└─────────┴─────────┴───────────┴──────────┘
> schema(db.coll, { verbose: true });
{
fields: [
{
name: '_id',
// [ ... ]
},
{
path: 'a',
count: 2,
types: [
{
name: 'Number',
path: 'a',
probability: 0.5,
unique: 1,
// [ ... ]
},
{
name: 'String',
bsonType: 'String',
// [ ... ]
}
],
total_count: 2,
type: [ 'Number', 'String' ],
probability: 1
}
],
count: 2
}
FAQs
schema(db.coll)
The npm package @mongosh/snippet-analyze-schema receives a total of 2,077 weekly downloads. As such, @mongosh/snippet-analyze-schema popularity was classified as popular.
We found that @mongosh/snippet-analyze-schema demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 11 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
The MCP community is launching an official registry to standardize AI tool discovery and let agents dynamically find and install MCP servers.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.