{"id":16048974,"url":"https://github.com/devongovett/jquery-db","last_synced_at":"2026-03-04T04:02:57.045Z","repository":{"id":946629,"uuid":"725012","full_name":"devongovett/jQuery-DB","owner":"devongovett","description":"A JavaScript data store queried by jQuery-like selectors","archived":false,"fork":false,"pushed_at":"2010-06-17T02:19:15.000Z","size":84,"stargazers_count":8,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-11-18T04:03:47.539Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/devongovett.png","metadata":{"files":{"readme":"README","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":"2010-06-17T00:17:25.000Z","updated_at":"2019-04-19T20:26:50.000Z","dependencies_parsed_at":"2022-07-05T23:30:08.189Z","dependency_job_id":null,"html_url":"https://github.com/devongovett/jQuery-DB","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/devongovett/jQuery-DB","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devongovett%2FjQuery-DB","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devongovett%2FjQuery-DB/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devongovett%2FjQuery-DB/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devongovett%2FjQuery-DB/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/devongovett","download_url":"https://codeload.github.com/devongovett/jQuery-DB/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/devongovett%2FjQuery-DB/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30071670,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-04T03:25:38.285Z","status":"ssl_error","status_checked_at":"2026-03-04T03:25:05.086Z","response_time":59,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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-09T00:12:00.001Z","updated_at":"2026-03-04T04:02:57.027Z","avatar_url":"https://github.com/devongovett.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"jQuery DB - A JavaScript data store queried by jQuery-like selectors\nBy Devon Govett\nLicence: Do whatever you want, just fork and hack away!\n\n/******************\n ** DOCUMENTATION\n *****************/\n\nStep 1: Create a data store\n\tvar db = new DataStore(\"awesome\");\n\t\nStep 2: Create some records and add them to the database\n\tdb.create({\n\t\tfoo: \"bar\",\n\t\thello: \"world\"\n\t}).appendTo(\"awesome\");\n\t\nStep 3: Find some records\n\tvar records = db.get(\"awesome[foo=bar]\")\n\t\nStep 4: Do stuff with the records\n\trecords.update(\"hello\", \"coder\");\n\t\nStep 5: Bind an event to be notified when data changes\n\tdb.bind(\"awesome[hello!=coder]\", function(event) {\n\t\t//do stuff (see Mutation Events, below, for details on the event object)\n\t});\n\t\n\t\n/**************\n ** SELECTORS\n *************/\n \nTable selector\n \tdb.get(\"tablename\") //get all records in table\n \t\nAttribute selector\n \tdb.get(\"tablename[attr=value]\") //get records in tablename whose attribute \"attr\" equals \"value\"\n \tdb.get(\"tablename[attr!=value]\") //get records in tablename whose attribute \"attr\" does not equal \"value\"\n \tdb.get(\"tablename[attr^=value]\") //get records in tablename whose attribute \"attr\" starts with \"value\"\n \tdb.get(\"tablename[attr$=value]\") //get records in tablename whose attribute \"attr\" ends with \"value\"\n \tdb.get(\"tablename[attr*=value]\") //get records in tablename whose attribute \"attr\" contains \"value\"\n\nFilter selectors\n\tdb.get(\"tablename:first\") //get the first record in tablename\n\tdb.get(\"tablename:last\") //get the last record in tablename\n\tdb.get(\"tablename:even\") //get all of the even indexed records in tablename\n\tdb.get(\"tablename:odd\") //get all of the odd indexed records in tablename\n\tdb.get(\"tablename:eq(5)\") //get the 5th record in tablename\n\tdb.get(\"tablename:gt(5)\") //get all of the the records with an index greater than 5 in tablename\n\tdb.get(\"tablename:lt(5)\") //get all of the the records with an index less than 5 in tablename\n\t\n\t\n/*************************\n ** RESULT SET OPERATIONS\n ************************/\n \nLoop through each record in the set\n \tset.each(function(i) {\n \t\t//do stuff\n \t});\n \t\nGet a specific record\n \tset[index] //get the record at index from set\n \tset.eq(index) //ditto\n \t\nFilter the set\n \tset.filter(\":odd\") //filter the set by a string selector\n \tset.filter(function(i) { return i % 2; }) //filter the set by a function\n \t\nGet a specific property from all records in the set\n \tset.map(\"name\") //return an array of all name properties in the set\n \tset.map(function() { return this.name; }) //ditto\n \t\nUpdate all records in the set\n \tset.update(prop, val) //update all records in the set, setting prop to val\n \tset.update({ foo: \"bar\", hello: \"world\" }) //update set with all changes in the hash\n \t\nRemove all records from the set\t\n\tset.remove()\n\t \nAdd records to a table\n\tset.appendTo(tablename) //append the records in the set to tablename\n\tset.prependTo(tablename) //prepend the records in the set to tablename\n\tset.insertInto(tablename, index);\n \t\n \n /********************\n  ** MUTATION EVENTS\n  *******************/\n  \nMutation events (received from db.bind, see above) have the following properties\n\ttype: one of the mutation types (append, prepend, insert, update, or remove)\n\tindex: an array of modified indexes for insert update and remove events\n\tdata: an array of objects being inserted for append, prepend and insert events","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevongovett%2Fjquery-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdevongovett%2Fjquery-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdevongovett%2Fjquery-db/lists"}