{"id":21436950,"url":"https://github.com/axfab/tiny-db","last_synced_at":"2025-03-16T23:24:08.775Z","repository":{"id":29764281,"uuid":"33308115","full_name":"AxFab/tiny-db","owner":"AxFab","description":"Small document database. Create a store of JSON documents","archived":false,"fork":false,"pushed_at":"2015-04-03T14:07:01.000Z","size":118,"stargazers_count":0,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-25T02:39:43.189Z","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/AxFab.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":"2015-04-02T12:40:55.000Z","updated_at":"2015-04-03T14:07:02.000Z","dependencies_parsed_at":"2022-07-22T08:21:55.680Z","dependency_job_id":null,"html_url":"https://github.com/AxFab/tiny-db","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxFab%2Ftiny-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxFab%2Ftiny-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxFab%2Ftiny-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/AxFab%2Ftiny-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/AxFab","download_url":"https://codeload.github.com/AxFab/tiny-db/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243945852,"owners_count":20372947,"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-11-23T00:16:57.879Z","updated_at":"2025-03-16T23:24:08.758Z","avatar_url":"https://github.com/AxFab.png","language":"JavaScript","readme":"# Tiny DB\n\nTiny DB is a JSON document store database. \n\nThe API is based on MongoDB, however it may not stay compatible forever.\n\n\n## Getting started\n\nThe configuration is prety straitforward, this is one of the most important aspect of TinyDB:\nEasy to install, easy to use.\n\nThe client will try to connect to the service using a single url parameter.\nTo start either choose null for an in-memory database or a local directory to use as storage.\nFor more option refer to the section named scalling service.\n\n\nI will present here the most useful function that you need to\nstart using your new database.\n\n### Connection\n\n\n```\n// Connection URL\nvar url = null; // Use in-memory database\n// Use connect method to connect to db service\nClientDb.connect(url, function(err, db) {\n  // ...\n})\n```\n\n\n### Insertion\n\nInserts a document or documents into a collection.\n\nThe method take either a simple object or an array of object. \nThe second argument can be an option object with some settings, and the last \nargument is a callback to call at the end of the query.\n\n```\n// Get the documents collection\nvar collection = db.collection('documents')\n// Insert some documents\ncollection.insert([\n    {a : 1}, {a : 2}, {a : 3}\n  ], function (err, res) {\n    // ...\n  })\n```\n\nOptions are:\n  - `writeConcern` : See Safe Writes.\n  - `ordered` : Should the items inserted in given order or in parralel.\n\n### Update\n\n```\n// Get the documents collection\nvar collection = db.collection('documents')\n// Insert some documents\ncollection.update(\n  { a : 2 },\n  { $set: { b : 1 } },\n  function (err, res) {\n    // ...\n  })\n```\n\n### Delete\n\n```\n// Get the documents collection\nvar collection = db.collection('documents')\n// Insert some documents\ncollection.update(\n  { a : 3 },\n  function (err, res) {\n    // ...\n  })\n```\n\n### Find\n\n```\n// Get the documents collection\nvar collection = db.collection('documents')\n// Insert some documents\ncollection.find({}).toArray(function (err, docs) {\n    // ...\n  })\n```\n\n## Scalling service\n\n \u003e Not implemented \n\n\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxfab%2Ftiny-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Faxfab%2Ftiny-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Faxfab%2Ftiny-db/lists"}