{"id":16731477,"url":"https://github.com/skratchdot/mesh","last_synced_at":"2025-03-23T15:31:00.905Z","repository":{"id":3992378,"uuid":"5088977","full_name":"skratchdot/mesh","owner":"skratchdot","description":"An extended shell for MongoDB","archived":false,"fork":false,"pushed_at":"2013-09-26T22:15:06.000Z","size":321,"stargazers_count":37,"open_issues_count":0,"forks_count":8,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-03-18T21:50:52.976Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"http://skratchdot.com/projects/mesh/","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/skratchdot.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE-GPL.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2012-07-17T22:26:10.000Z","updated_at":"2024-01-24T20:13:14.000Z","dependencies_parsed_at":"2022-08-06T14:30:23.836Z","dependency_job_id":null,"html_url":"https://github.com/skratchdot/mesh","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fmesh","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fmesh/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fmesh/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/skratchdot%2Fmesh/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/skratchdot","download_url":"https://codeload.github.com/skratchdot/mesh/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245122685,"owners_count":20564357,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-12T23:37:30.290Z","updated_at":"2025-03-23T15:31:00.578Z","avatar_url":"https://github.com/skratchdot.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":" mesh - MongoDB Extended Shell\n===============================\n\n\n## Description ##\n\nmesh (**M**ongoDB **E**xtended **Sh**ell) is a javascript file that extends\nthe mongo shell.  It includes some useful libraries, as well as new functions\nfor dealing with Mongo collections and queries.\n\n\n## Installation ##\n\n**Download:** [mesh.js](https://github.com/skratchdot/mesh/raw/master/mesh.js)\n\n#### Option 1 ####\n\nAdd this script to your .mongorc.js file.  \n\n_See:_ [http://www.mongodb.org/display/DOCS/Overview+-+The+MongoDB+Interactive+Shell#Overview-TheMongoDBInteractiveShell-.mongorc.js](http://www.mongodb.org/display/DOCS/Overview+-+The+MongoDB+Interactive+Shell#Overview-TheMongoDBInteractiveShell-.mongorc.js)\n\n_Example .mongorc.js:_\n\n    load('mesh.js');\n    load('mesh.config.js');\n\n\n#### Option 2 ####\n\nStart the shell after executing this script  \n\n    mongo --shell mesh.js\n\n\n## What's Included? ##\n\n- [underscore.js](http://documentcloud.github.com/underscore/) - Underscore.js is a\n  utility-belt library for JavaScript that provides support for the usual functional\n  suspects (each, map, reduce, filter...) without extending any core JavaScript objects.\n\n- [underscore.string.js](http://epeli.github.com/underscore.string/) - Javascript lacks\n  complete string manipulation operations.  This an attempt to fill that gap.\n\n- [moment.js](http://momentjs.com/) - A lightweight javascript date library for parsing,\n  validating, manipulating, and formatting dates.\n\n- [science.js](https://github.com/jasondavies/science.js) - Scientific and statistical computing\n  in JavaScript.\n\n- [distinct2()](http://skratchdot.com/projects/mongodb-distinct2/) - Similar to the built-in distinct()\n  function, but with more capabilities.\n\n- [distinctTypes()](http://skratchdot.com/projects/mongodb-distinct-types/) - Similar to the \n  db.myCollection.distinct() function, distinctTypes() will return \"types\" rather than \"values\".\n\n- [flatten()](http://skratchdot.com/projects/mongodb-flatten/) - The flatten() function is a \n  mapReduce that flattens documents into key/value pairs.\n\n- [schema()](http://skratchdot.com/projects/mongodb-schema/) - A schema analysis tool for MongoDB.\n\n- [wild()](http://skratchdot.com/projects/mongodb-wild/) - Adds a wildcard search to the mongodb shell.\n\n- A console wrapper so calls like console.log() and console.dir() don't error out\n\n- mesh.setPrompt(): a way to configure your prompt. Can set a default in mesh.config.js\n\n- mesh.keys(): will return all the \"global\" properties as a sorted array.\n\n- [JSON-js](https://github.com/douglascrockford/JSON-js) - JSON.stringify() and JSON.parse()\n\n- mesh.oid() - a wrapper for ObjectId()\n\n- mesh.tid() - a wrapper for creating ObjectId values based on a timestamp\n\n- a few [underscore.js mixins](https://github.com/skratchdot/snippets/tree/master/underscore.js/)\n\n- [DBCollection.insertArray()](https://github.com/skratchdot/mesh/blob/master/src/mongodb.insertArray.js) - insert an array of objects into a collection\n\n- [mesh.idrange.js](https://github.com/skratchdot/mesh/blob/master/src/mesh.idrange.js) - search collections\n  for documents with ids created between 2 datetimes\n\n- [mesh.sizeinfo.js](https://github.com/skratchdot/mesh/blob/master/src/mesh.sizeinfo.js) - reports the\n  count/sum/avg/max/min of all bson sizes for the given query/collection.\n\n\n## Configuration ##\n\nYou can configure mesh by calling **mesh.config(settings)**. The benefit of keeping a config file,\nis that you won't lose your default settings when updating mesh. Currently, there are 2 config values:\ndefaultPrompt and aliases.\n\nYou can create a file \"mesh.config.js\".  It might look like:\n\n    mesh.config({\n    \t\tdefaultPrompt : 4,\t\t// 0-4 or a string\n    \t\taliases : {\t\t\t\t// can pass in a map of aliases.\n    \t\t\t't' : 'mesh.tid',\t// t() is an alias for mesh.tid()\n    \t\t\t'o' : 'ObjectId',\t// o() is an alias for ObjectId()\n    \t\t\t'm' : 'mesh'\t\t// m is an alias for mesh\n    \t\t}\n    });\n\nNow, when starting the shell, you can pass in the **mesh.config.js** file along with your \n**mesh.js** file like:\n\n    mongo --shell mesh.js mesh.config.js\n\nOr if you are using .mongorc.js:\n\n    load('mesh.js');\n    load('mesh.config.js');\n\n\n## Usage ##\n\ncoming soon\n\n\n## For Developers ##\n\n\n#### Getting The Code ####\n\n    git clone git://github.com/skratchdot/mesh.git\n    cd mesh\n    git submodule update --init --recursive\n\n\n#### Updating submodule sources ####\n\n    git submodule foreach git pull\n\n\n#### Building mesh.js ####\n\n    npm install\n    grunt\n\n\n## Version History ##\n\n#### v1.5.0 - Released September 25, 2013\n  * using grunt.js as the build system\n  * adding [mesh.idrange.js](https://github.com/skratchdot/mesh/blob/master/src/mesh.idrange.js) - search collections\n    for documents with ids created between 2 datetimes\n  * adding [mesh.sizeinfo.js](https://github.com/skratchdot/mesh/blob/master/src/mesh.sizeinfo.js) -\n    reports the count/sum/avg/max/min of all bson sizes for the given query/collection.\n  * updating the following libraries: [JSON-js](https://github.com/douglascrockford/JSON-js),\n  [moment](http://momentjs.com/), [underscore.js](http://documentcloud.github.com/underscore/),\n  [underscore.string.js](http://epeli.github.com/underscore.string/)\n\n#### v1.4.3 - Released March 7, 2013\n  * adding mesh.ops which prints all operations.\n  * no longer printing version when tabbing.\n  * updating the following libraries: [JSON-js](https://github.com/douglascrockford/JSON-js),\n  [moment](http://momentjs.com/), [distinct2()](http://skratchdot.com/projects/mongodb-distinct2/),\n  [schema()](http://skratchdot.com/projects/mongodb-schema/), and\n  [underscore.js](http://documentcloud.github.com/underscore/)\n\n#### v1.4.2 - Released February 7, 2013\n  * updating the following libraries: [moment](http://momentjs.com/),\n  [science.js](https://github.com/jasondavies/science.js),\n  [underscore.js](http://documentcloud.github.com/underscore/), and\n  [underscore.string.js](http://epeli.github.com/underscore.string/)\n\n#### v1.4.1 - Released December 10, 2012\n  * adding [DBCollection.insertArray()](https://github.com/skratchdot/mesh/blob/master/src/mongodb.insertArray.js)\n  * adding [JSON-js](https://github.com/douglascrockford/JSON-js) - json2.js and cycle.js\n  * updating [distinct2()](http://skratchdot.com/projects/mongodb-distinct2/),\n  [underscore.js](http://documentcloud.github.com/underscore/), and\n  [moment.js](http://momentjs.com/)\n\n#### v1.4.0 - Released December 9, 2012\n  * updating [distinct2()](http://skratchdot.com/projects/mongodb-distinct2/)\n  * adding some [underscore.js mixins](https://github.com/skratchdot/snippets/tree/master/underscore.js/)\n    - [underscore.aggregate.js](https://github.com/skratchdot/snippets/tree/master/underscore.js/underscore.aggregate.js)\n    - [underscore.avg.js](https://github.com/skratchdot/snippets/tree/master/underscore.js/underscore.avg.js)\n    - [underscore.deepExtend.js](https://github.com/skratchdot/snippets/tree/master/underscore.js/underscore.deepExtend.js)\n    - [underscore.deepPluck.js](https://github.com/skratchdot/snippets/tree/master/underscore.js/underscore.deepPluck.js)\n    - [underscore.keyToObject.js](https://github.com/skratchdot/snippets/tree/master/underscore.js/underscore.keyToObject.js)\n    - [underscore.stdev.js](https://github.com/skratchdot/snippets/tree/master/underscore.js/underscore.stdev.js)\n    - [underscore.sum.js](https://github.com/skratchdot/snippets/tree/master/underscore.js/underscore.sum.js)\n    - [underscore.variance.js](https://github.com/skratchdot/snippets/tree/master/underscore.js/underscore.variance.js)\n\n#### v1.3.1 - Released November 15, 2012\n  * adding mesh.setAliases()\n  * removing globalTid and globalOid from mesh.config in favor of using 'aliases'.\n  * mesh.tid() now accepts an optional \"increment\" argument\n  * reload mesh each time load('mesh.js') is called\n  * fixing build process (version and date replaced)\n  * fixing bug w/ how hostname is determined in prompt\n  * removing moment() / window hack\n\n#### v1.3.0 - Released November 13, 2012\n  * updating libraries: [moment.js](http://momentjs.com/),\n  [distinct2()](http://skratchdot.com/projects/mongodb-distinct2/),\n  [underscore.js](http://documentcloud.github.com/underscore/), and\n  [underscore.string.js](http://epeli.github.com/underscore.string/)\n  * adding mesh.oid() - a wrapper for ObjectId()\n  * adding mesh.tid() - a wrapper for creating ObjectId values based on a timestamp\n  * config values to change mesh.tid() to t() or mesh.oid() to o()\n\n#### v1.2.4 - Released October 22, 2012\n  * updating libraries: [flatten()](http://skratchdot.com/projects/mongodb-flatten/)\n  and [underscore.js](http://documentcloud.github.com/underscore/)\n\n#### v1.2.3 - Released October 21, 2012\n  * updating libraries: [flatten()](http://skratchdot.com/projects/mongodb-flatten/)\n\n#### v1.2.2 - Released October 20, 2012\n  * updating libraries: [flatten()](http://skratchdot.com/projects/mongodb-flatten/),\n  [underscore.js](http://documentcloud.github.com/underscore/), and\n  [underscore.string.js](http://epeli.github.com/underscore.string/)\n\n#### v1.2.1 - Released October 7, 2012\n  * updating libraries: [moment.js](http://momentjs.com/),\n  [distinct2()](http://skratchdot.com/projects/mongodb-distinct2/), and\n  [underscore.js](http://documentcloud.github.com/underscore/)\n  * [json2.js](https://github.com/douglascrockford/JSON-js) is now included due \n    to the [distinct2()](http://skratchdot.com/projects/mongodb-distinct2/) upgrade\n\n#### v1.2.0 - Released September 24, 2012\n  * mesh.setPrompt() is now mesh.prompt()\n  * updating libraries\n  * adding mesh.time() which displays function execution times\n\n#### v1.1.4 - Released August 20, 2012\n  * removing [Sugar](http://sugarjs.com/) (rely on [underscore.js](http://documentcloud.github.com/underscore/) instead)\n  * updating submodules\n\n#### v1.1.3 - Released August 16, 2012\n  * adding [science.js](https://github.com/jasondavies/science.js)\n\n#### v1.1.2 - Released August 16, 2012\n  * Mix in non-conflicting string functions to the Underscore namespace\n  * adding [Sugar](http://sugarjs.com/)\n  * using minified version of [moment.js](http://momentjs.com/)\n\n#### v1.1.1 - Released August 16, 2012\n  * Updating submodules\n  * Updating README.md with \"What's Included?\" descriptions\n  * Updating README.md with \"For Deveopers\" section\n  * Small fix to [distinct2.js](http://skratchdot.com/projects/mongodb-distinct2/)\n\n#### v1.1.0 - Released August 15, 2012 ####\n  * Adding [distinct2.js](http://skratchdot.com/projects/mongodb-distinct2/)\n  * implementing mesh.toString() so the console prints help info\n\n#### v1.0.0 - Released July 17, 2012 ####\n  * Initial Release\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskratchdot%2Fmesh","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fskratchdot%2Fmesh","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fskratchdot%2Fmesh/lists"}