{"id":17349283,"url":"https://github.com/co2-git/boojs","last_synced_at":"2025-03-27T11:44:33.438Z","repository":{"id":24276048,"uuid":"27670514","full_name":"co2-git/boojs","owner":"co2-git","description":"boo is a database written in JavaScript with the following features:  - memory database - tcp socket server - event-driven (all clients get notified in real time of any watched events)","archived":false,"fork":false,"pushed_at":"2015-01-18T17:49:45.000Z","size":360,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-01T16:23:27.202Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/co2-git.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2014-12-07T13:10:21.000Z","updated_at":"2015-01-18T17:49:45.000Z","dependencies_parsed_at":"2022-08-22T14:40:52.228Z","dependency_job_id":null,"html_url":"https://github.com/co2-git/boojs","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co2-git%2Fboojs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co2-git%2Fboojs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co2-git%2Fboojs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/co2-git%2Fboojs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/co2-git","download_url":"https://codeload.github.com/co2-git/boojs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245841692,"owners_count":20681184,"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-15T16:55:15.964Z","updated_at":"2025-03-27T11:44:33.416Z","avatar_url":"https://github.com/co2-git.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"boo.js `alpha`\n============\n\n\n\n            /  |                                               \n            ## |____    ______    ______          __   _______ \n            ##      \\  /      \\  /      \\        /  | /       |\n            #######  |/######  |/######  |       ##/ /#######/ \n            ## |  ## |## |  ## |## |  ## |       /  |##      \\ \n            ## |__## |## \\__## |## \\__## |__     ## | ######  |\n            ##    ##/ ##    ##/ ##    ##//  |    ## |/     ##/ \n            #######/   ######/   ######/ ##/__   ## |#######/  \n                                           /  \\__## |          \n                                           ##    ##/           \n                                            ######/             \n                                    \n                                            \n                       .. ..oooo.....ooo...\n                    .odSS4PYYYSSOOXXXXXXXXXOodbgooo.\n                   /SSYod$$$$SSOIIPXXXXXXXXXYYP.oo.*b.\n                  ($$Yd$$$$SSSOII:XXXXXXXX:IIoSSS$$b.Y,\n                   \\Yd$$$$SSSOII:XXXXXXXXXX:IIOOSSS$$$b\\\n                    d$$$$SSSOOI:XP\"YXXXXXXXX:IIOOSSSS$$$\\\n                    Y$$$SSSOOII:XbdXXXXXP\"YX:IIOOOSS$$$$)\n                    'Y$$$SSSOI:XXXXXXXXXbodX:IIOOSS$$$$$/\n                     \"Y$$$SSSOI(PoTXXXXXTo)XXIIOOOSS$$$*'\n                       \"\"*Y$S(((PXXXXXXXY))dIIOSSS$$dP'\n                          \"*'()P;XXXXXXXXY)IIOSSS$P\".oS,\n                          (S'(P;XXXXXXXP;Y)XXYOP\".oSSSSb\n                         (S'(P;'XXXXXXX';Y).ooooSSSSSSSS)\n                         (S'(P;'XXXXXXP';Y).oSSSSSSSSSSSP\n                         (SS'Y);YXXXXX';(Y.oSSSSSSSSSSSSP\n                          YSS'Y)'YXXX\".(Y.oSSP.SSSSSSSSY\n                           YSS'\"\" XXX\"\"oooSSP.SSSSSSSSY\n                           SSSSSS YXXX:SSSSP.SSSSSSSSY\n                           SSSSSP  YXb:SSSP.S\"SSSSSSP\n                           S(OO)S   YXb:SY    )SSSSS\n                           SSSSO    )YXb.I    ISSSSP\n                           YSSSY    I.\"YXXb   Y(SS)I\n                           )SSS(    dSSo.\"\"*b  YSSSY\n                           OooSb   dSSSSP      )SSS(\n                                   dSSSY       OooSS\n                                   OooSP\n\n\n\nboo is a database written in JavaScript with the following features:\n\n- memory database\n- tcp socket server\n- event-driven (all clients get notified in real time of any watched events)\n\n# Install\n\n```bash\nnpm install co2-git/boojs\n```\n\n# Usage\n\n```js\n\nvar boo = require('boo');\n\n// Create new client\n\nclient = boo.client({ collection: 'players' });\n\n// Create a new document\n\nclient.insert({ name: \"Toni\", score: 100, team: \"red\" });\n\n// Update (increment Toni's score by 100)\n\nclient.update({ name: \"Toni\", $inc: { score: 100 } });\n\n// Find Toni\n\nclient.find({ name: \"Toni\" });\n\n// Increment each team red's players every time they have a new member\n\nclient.on('inserted', function (players) {\n\n  // Find out how many of the new players are from team red\n  \n  var newMembers = players\n    \n    .filter(function (player) {\n      return player.team === 'red';\n    })\n    \n    .map(function (player) {\n      return { $id: player.$id };\n    });\n  \n  // Update each player of team red, except new ones\n  \n  if ( newMembers.length ) {\n    client.update('players', {\n      team: 'red',\n      $id: { $not: newMembers },\n      $inc: { score: ( 100 * newMembers.length ) } }); \n  }\n});\n\n```\n\n# Connexion\n\nboo uses a URL format to identify connexions:\n\n    boo://\u003cserver\u003e(:\u003cport\u003e)(/dbname(/collectionName))\n    \nDefault address is:\n\n    boo://localhost:7000/boo-db/boo-sandbox\n\n# Server\n\nboo server starts automatically when a client requires it.\n\n```js\nboo.client(); // will use default address\nboo.client('boo://app.com:9009'); // specify a diffent host and port\nboo.client('test'); // will use default address but with \"test\" as database\nboo.client('test/running'); // will use default address but with \"test\" as database and \"running\" as collection\nboo.client(9876); // will use default address but with 9876 as port\nboo.client({ host: 'app.com', port: 9009, database: 'test', collection: 'users'); // Use object for finer control\n```\n\n# Client\n\nYou can use boo module to statically create a new client, or called the Client library directly:\n\n```js\nvar client = boo.client();\n\n// is the same than\n\nvar client = new (require('boo/lib/class/Client'))();\n```\n\n# Query\n\nSpecial queries are prefixed by a dollar sign `$` and injected into the regular query:\n\n```js\n// name is Joe and score is greater than 100\nclient.find({ name: 'Joe', score: { $gt: 100 } });\n```\n\n# Query operators\n\n## `$not`\n\n```js\n// name is not Joe\nclient.find({ name: { $not: 'Joe' } });\n\n// name is neither Joe nor Jessica\nclient.find({ name: { $not: ['Joe', 'Jessica'] } });\n```\n\n### Aliases\n\n- `$ne`\n\n## `$in`\n\n```js\n// name is either Joe or Jessica\nclient.find({ name: { $in: ['Joe', 'Jessica' ] } });\n```\n\n## `$gt`\n\n```js\n// score is greater than 100\nclient.find({ score: { $gt: 100 } });\n```\n\n### Aliases\n\n- `$greaterThan`\n- `$above`\n\n# Test\n\nTests are written in Mocha and shouldjs.\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fco2-git%2Fboojs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fco2-git%2Fboojs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fco2-git%2Fboojs/lists"}