{"id":18656009,"url":"https://github.com/sysborg/sorla-db","last_synced_at":"2025-10-26T21:33:27.744Z","repository":{"id":159602094,"uuid":"634731577","full_name":"sysborg/sorla-db","owner":"sysborg","description":"A simple and temporary database focused to use in browser environment that will bring capabilities for other tools that will be launched as soon as possible.","archived":false,"fork":false,"pushed_at":"2024-03-06T13:33:06.000Z","size":749,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-12-27T14:41:38.081Z","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":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/sysborg.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2023-05-01T03:16:35.000Z","updated_at":"2024-02-02T11:18:36.000Z","dependencies_parsed_at":null,"dependency_job_id":"7b83e43b-fb5d-468d-b4ea-c2a5ad4b89c6","html_url":"https://github.com/sysborg/sorla-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/sysborg%2Fsorla-db","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysborg%2Fsorla-db/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysborg%2Fsorla-db/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/sysborg%2Fsorla-db/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/sysborg","download_url":"https://codeload.github.com/sysborg/sorla-db/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239470881,"owners_count":19644204,"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-07T07:21:25.208Z","updated_at":"2025-10-26T21:33:22.711Z","avatar_url":"https://github.com/sysborg.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# sorla-db\nA simple and temporary database focused to use in browser environment that will bring capabilities for other tools that will be launched as soon as possible.\n\nThis idea is from our founder #andmarruda that give this idea and alot of this idea are developed by him.\n\nTo create a minify file run\n```\nnode index.js\n```\n\nTo test the environment using jest run...\nDon`t forget to install the dev dependecies before, using:\n\n```\nnpm install --only=dev\n```\n\n```\nnpm test\n```\n\nSoon some documentations....\n\nProhibited characters $ and .,\n$ because is used to call operators and . because uses to search key inside a object's object\n\n## Registering and creating a collection example\n```\nwindow.sorla = new sorla();\nwindow.sorla.createDb('tags');\nwindow.sorla.useDb('tags');\nwindow.sorla.db.createCollection('updatedTags');\nwindow.sorla.db.updatedTags.insertMany([\n  {\n    name: 'Sonia',\n    age: 53\n  },\n  {\n    name: 'Anderson',\n    age: 36\n  }\n]);\n```\n\n## Find Operators\n\n### $and\n\nThe **$and** operator meticulously processes arrays, employing a loop chain mechanism. During this process, it's engineered for efficiency: if it encounters any comparison that yields **false**, it immediately halts the ongoing chain. This intelligent design is aimed at preventing unnecessary computation time, especially when dealing with documents that don't meet the specified condition. It's all about optimizing performance and ensuring swift, precise operations.\n\n### Example\n\n```\nconst results = window.sorla.db.updatedTags.find({\n  $and: [\n    {name: 'Anderson'},\n    {age: 36}\n  ]\n});\n```\n\n### $or\nThe **$or** operator processes arrays, emploing a loop chain mechanism. During this process, it~s engineered for efficiency: if it enconters any comparison that yields **true**, it imediately halts\nthe ongoing chain. The intelligent design is aimed at preventing unnecessary computation time, especially when dealing with documents that the first condition matchs the needs. It's all about optimizing\nperformance and ensuring swift, precise operations.\n\n### Example\n\n```\nconst results = window.sorla.db.updatedTags.find({\n  $or: [\n    {name: 'Anderson'},\n    {age: 53}\n  ]\n});\n```\n\n### $not\nThe **$not** operator processes the queries and invert the bool result, for example if {age: 36} return true for Anderson and false for Sonia then Sonia will be the one who will be returned,\nremember about invert the boolean result? Anderson that is true becomes false and Sonia that is false becomes true.\n\n```\nconst results = window.sorla.db.updatedTags.find({\n  age: {\n    $not: {$eq: 36}\n  }\n});\n```\n\n## Comparison operators\n\n### $eq\n$eq get all the documents that has exactly the same value as requested.\nFor example if we ask age: { $eq: 53 }, will return one document in this example,\nbut in general pourpose will return all documents that age is equal than 53.\n\n```\nconst results = window.sorla.db.updatedTags.find({\n  age: { $eq: 36 }\n});\n```\n\n### $ne\n$ne or not equal operator search all lines that doens't have the inputed value.\nFor example $ne:36, will return 1 line in this example, but for general pourpose will\nreturn all lines that age isn't 36.\n\n```\nconst results = window.sorla.db.updatedTags.find({\n  age: { $ne: 36 }\n});\n```\n\n### $gt\n$gt compares values that is greater than, for example everyone who have age above 20, all the documents will return in this example.\n```\nconst results = window.sorla.db.updatedTags.find({\n  age: { $gt: 36 }\n});\n```\n\n### $gte\n$gte compares values that is greater or equal than, for example everyone who have age above 20, all the documents will return in this example.\nBut if we put there for example greater or equal than 53, will return only one document.\n```\nconst results = window.sorla.db.updatedTags.find({\n  age: { $gte: 36 }\n});\n```\n\n### $lt\n$lt compares values that is smaller than, for example everyone who have age smaller than 30, in the documents in this example will return no one,\nbecause no one has age smaller than 30.\n```\nconst results = window.sorla.db.updatedTags.find({\n  age: { $lt: 30 }\n});\n```\n\n### $lte\n$lte compares values that is smaller or equal than, for example veryone who have age smaller then 36, in the documents in this example will return one,\nbecause Anderson has age of 36 that is equal 36, remember smaller or equal.\n```\nconst results = window.sorla.db.updatedTags.find({\n  age: { $lte: 36 }\n});\n```\n\n### $in\n$in operator compares if any value inside an array exists, like in operator in SQL, i will add a exemplo here that will return only one document.\nWill return Anderson because age 36 exists is in array object.\n```\nconst results = window.sorla.db.updatedTags.find({\n  age: { $in: [36, 44]}\n});\n```\n\n### $nin\n$nin operator is opposite of $in operator, returns only documents that the values doesn't match with any of the query.\nThis will result in a total of 0 documents.\n```\nconst results = window.sorla.db.updatedTags.find({\n  age: { $nin: [36, 53]}\n});\n```","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysborg%2Fsorla-db","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsysborg%2Fsorla-db","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsysborg%2Fsorla-db/lists"}