MCPcopy Index your code
hub / github.com/amark/mongous

github.com/amark/mongous @v0.1.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.1.0 ↗ · + Follow
7 symbols 10 edges 11 files 0 documented · 0%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Mongous

Mongous, for humongous, is a dead simple and blazing fast MongoDB driver that uses a jQuery like syntax. Note: Due to a small unfixed bug with the find() funciton, please explicitly call db('').open();

How it works

var db = require(PATH_TO_MONGOUS +'/mongous').Mongous;
db('hello.world').save({foo: 'bar'});

Done. App development has never felt as close to the shell as this! Making it a breeze to grab'n'store anything anywhere in your code without the nasty hassle of connections, collections, and cascading callbacks.

Database & Collections

  • db('Database.Collection')
    • Database is the name of your database
    • Collection is the name of your collection
    • Examples
      • db('blog.post')
      • db('blog.post.body')

Commands

  • Update db('blog.post').update(find, update, ...)
    • find is the object you want to find.
    • update is what you want to update find with.
    • ...
      • { upsert: true, multi: false }
      • true, true
  • Save db('blog.post').save(what)
    • what is the object to be updated or created.
  • Insert db('blog.post').insert(what...)
    • what is an object to be created. is an array of objects to be created.
    • Examples
      • db('blog.post').save({hello: 'world'})
      • db('blog.post').save([{hello: 'world'}, {foo: 'bar'}])
      • db('blog.post').save({hello: 'world'}, {foo: 'bar'})
  • Remove db('blog.post').remove(what, ...)
    • what is the object to be removed.
    • ... true for atomic.
  • Find db('blog.users').find(..., function(reply){ })
    • reply is the reply from MongoDB.
    • reply.documents are the documents that you found from MongoDB.
    • ...

      params are filtered by type - Objects - first object is what you want to find. - second object are fields you want

Ex: { name: 1, age: 1 } - third object is any of the following options:

{ lim: x, skip: y } - Numbers - first number is the limit (return all if not specified) - second number is the skip - Examples - db('blog.users').find(5, function(reply){ })

        reply.documents is the first 5 documents,
    - <code>db('blog.users').find(5, {age: 23}, function(reply){ })</code>


        with age of 23,
    - <code>db('blog.users').find({age: 27}, 5, {name: 1}, function(reply){ })</code>


        and a name.
    - <code>db('blog.users').find(5, {age: 27}, {name: 1}, {lim: 10}, function(reply){ })</code>


        is the same as the previous example, except the limit is 10 instead of 5.
    - <code>db('blog.users').find(5, function(reply){ }, 2)</code>


        reply.documents skips the first 2 documents and is the next 3 documents.
    - <code>db('blog.users').find(function(reply){ }, {age: 25}, {}, {limit: 5, skip: 2})</code>


        is the same as the previous example except only of doucments with the age of 25.

Mongous is a reduction ('less is more') of node-mongodb-driver by Christian Kvalheim.

Core symbols most depended-on inside this repo

shl
called by 1
bson/binary_parser.js
ctor
called by 0
mongous.js
con
called by 0
mongous.js
mongous
called by 0
mongous.js
db
called by 0
mongous.js

Shape

Function 7

Languages

TypeScript100%

Modules by API surface

mongous.js6 symbols
bson/binary_parser.js1 symbols

For agents

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

⬇ download graph artifact