{"action":"closed","issue":{"url":"https://api.github.com/repos/techfort/LokiJS/issues/685","repository_url":"https://api.github.com/repos/techfort/LokiJS","labels_url":"https://api.github.com/repos/techfort/LokiJS/issues/685/labels{/name}","comments_url":"https://api.github.com/repos/techfort/LokiJS/issues/685/comments","events_url":"https://api.github.com/repos/techfort/LokiJS/issues/685/events","html_url":"https://github.com/techfort/LokiJS/issues/685","id":333455070,"node_id":"MDU6SXNzdWUzMzM0NTUwNzA=","number":685,"title":"Question - LokiJS vs plain JSON file to object? (Node)","user":{"login":"lethevimlet","id":2963923,"node_id":"MDQ6VXNlcjI5NjM5MjM=","avatar_url":"https://avatars1.githubusercontent.com/u/2963923?v=4","gravatar_id":"","url":"https://api.github.com/users/lethevimlet","html_url":"https://github.com/lethevimlet","followers_url":"https://api.github.com/users/lethevimlet/followers","following_url":"https://api.github.com/users/lethevimlet/following{/other_user}","gists_url":"https://api.github.com/users/lethevimlet/gists{/gist_id}","starred_url":"https://api.github.com/users/lethevimlet/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lethevimlet/subscriptions","organizations_url":"https://api.github.com/users/lethevimlet/orgs","repos_url":"https://api.github.com/users/lethevimlet/repos","events_url":"https://api.github.com/users/lethevimlet/events{/privacy}","received_events_url":"https://api.github.com/users/lethevimlet/received_events","type":"User","site_admin":false},"labels":[{"id":49293813,"node_id":"MDU6TGFiZWw0OTI5MzgxMw==","url":"https://api.github.com/repos/techfort/LokiJS/labels/wontfix","name":"wontfix","color":"ffffff","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2018-06-18T22:19:42Z","updated_at":"2018-08-26T17:48:27Z","closed_at":"2018-08-26T17:48:27Z","author_association":"NONE","body":"Hi, in my search for a simple local JS database for a small project I came across with LokiJS, and a few questions arose.  These are a few kind questions to help others and maybe contribute to the future of LokiJS.\r\n\r\n1. Aside from the search functions and the API resemblance to MongoDB, what advantages does LokiJS against a simple JSON file being parsed to an in-memory object? I can manipulate the object with less overhead and stringify it to a file when persistence is needed, and it has the same serialization limitations, size, I/O, etc so what are the advantages?\r\n\r\n2. Looking at the stored JSON I can see \"documents\" are stored in an array, I believe a simple object with a unique key could speed initial load and get() times, since it will never have to reconstruct and iterate through the array, acting much like a HashMap. I'm sure LokiJS creates an in-memory index for the unique keys but isn't this approach more reasonable to avoid the initial load times and queries?  \r\n\r\n```\r\n\"collections\": {\r\n  \"myCollection\" {\r\n    \"id1\": { ... },\r\n    \"id2\": { ... },\r\n  }\r\n}\r\n```\r\n\r\n3. How often should I split databases into multiple files, I know JSON files can reach 0.5 GB without a sweat but how well does LokiJS generate the initial indexing and save operations for big files?\r\n\r\n4. How could I save big chunks of text? I know I could always store the files separately and their paths in the actual collection, but is there a kind of binary format like BSON?\r\n\r\nAnyway, nice work with the project, keep it up ^_^ "}}
{"actor":{"display_login":"stale"}}