MCPcopy Index your code
hub / github.com/Automattic/monk

github.com/Automattic/monk @v7.3.2

Chat with this repo
repository ↗ · DeepWiki ↗ · release v7.3.2 ↗ · + Follow
18 symbols 30 edges 16 files 1 documented · 6% 7 cross-repo links updated 3y agov7.3.2 · 2020-08-31★ 1,83142 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Monk

A tiny layer that provides simple yet substantial usability improvements for MongoDB usage within Node.JS.

build status codecov Join the chat at https://gitter.im/Automattic/monk

note: monk 2.x drop the support for node < 0.12. If you are still using an earlier version, stick to monk 1.x

const db = require('monk')('localhost/mydb')
// or
// const db = require('monk')('user:pass@localhost:port/mydb')

const users = db.get('users')

users.index('name last')
users.insert({ name: 'Tobi', bigdata: {} })
users.find({ name: 'Loki' }, '-bigdata').then(function () {
  // exclude bigdata field
})
users.find({}, {sort: {name: 1}}).then(function () {
  // sorted by name field
})
users.remove({ name: 'Loki' })

db.close()

Features

  • Well-designed API signatures
  • Easy connections / configuration
  • Command buffering. You can start querying right away
  • Promises built-in for all queries. Easy interoperability with modules
  • Auto-casting of _id in queries
  • Allows to set global options or collection-level options for queries. (eg: castIds is true by default for all queries)

Middlewares

Most of the Monk's features are implemented as middleware.

There are a bunch of third-parties middlewares that add even more functionalities to Monk: - monk-middleware-wrap-non-dollar-update - monk-middleware-debug - monk-middleware-dereference

Created an nice middleware? Send a PR to add to the list!

How to use

Documentation

License

MIT

Extension points exported contracts — how you extend this code

Core symbols most depended-on inside this repo

Shape

Function 13
Class 4
Interface 1

Languages

TypeScript100%

Modules by API surface

lib/collection.js5 symbols
index.d.ts5 symbols
test/collection.js3 symbols
middlewares/handle-callback/index.js2 symbols
lib/manager.js2 symbols
middlewares/options/index.js1 symbols

Dependencies from manifests, versioned

@types/mongodb3.5.25 · 1×
ava0.19.1 · 1×
codecov2.2.0 · 1×
debug* · 1×
eslint3.19.0 · 1×
eslint-plugin-ava4.2.0 · 1×
eslint-plugin-node4.2.2 · 1×
eslint-plugin-standard3.0.1 · 1×
gitbook-cli2.3.0 · 1×

Datastores touched

(mongodb)Database · 1 repos

For agents

$ claude mcp add monk \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page