{"action":"created","issue":{"url":"https://api.github.com/repos/techfort/LokiJS/issues/601","repository_url":"https://api.github.com/repos/techfort/LokiJS","labels_url":"https://api.github.com/repos/techfort/LokiJS/issues/601/labels{/name}","comments_url":"https://api.github.com/repos/techfort/LokiJS/issues/601/comments","events_url":"https://api.github.com/repos/techfort/LokiJS/issues/601/events","html_url":"https://github.com/techfort/LokiJS/issues/601","id":251924412,"number":601,"title":"How can i implement rest calls to lokijs?","user":{"login":"eggzon","id":9060738,"avatar_url":"https://avatars1.githubusercontent.com/u/9060738?v=4","gravatar_id":"","url":"https://api.github.com/users/eggzon","html_url":"https://github.com/eggzon","followers_url":"https://api.github.com/users/eggzon/followers","following_url":"https://api.github.com/users/eggzon/following{/other_user}","gists_url":"https://api.github.com/users/eggzon/gists{/gist_id}","starred_url":"https://api.github.com/users/eggzon/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/eggzon/subscriptions","organizations_url":"https://api.github.com/users/eggzon/orgs","repos_url":"https://api.github.com/users/eggzon/repos","events_url":"https://api.github.com/users/eggzon/events{/privacy}","received_events_url":"https://api.github.com/users/eggzon/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2017-08-22T11:25:46Z","updated_at":"2017-09-10T02:39:47Z","closed_at":null,"author_association":"NONE","body":"Can someone help me how can i implement my rest calls to lokijs, for example i have this rest: https://address-book-demo.herokuapp.com/api/contacts and what i want here is passing all the data to LokiJs and then fetch it from Lokijs.\r\n\r\nOr at least if i have any option to import my db or load it from my directory"},"comment":{"url":"https://api.github.com/repos/techfort/LokiJS/issues/comments/328315749","html_url":"https://github.com/techfort/LokiJS/issues/601#issuecomment-328315749","issue_url":"https://api.github.com/repos/techfort/LokiJS/issues/601","id":328315749,"user":{"login":"hasahmad","id":12864989,"avatar_url":"https://avatars1.githubusercontent.com/u/12864989?v=4","gravatar_id":"","url":"https://api.github.com/users/hasahmad","html_url":"https://github.com/hasahmad","followers_url":"https://api.github.com/users/hasahmad/followers","following_url":"https://api.github.com/users/hasahmad/following{/other_user}","gists_url":"https://api.github.com/users/hasahmad/gists{/gist_id}","starred_url":"https://api.github.com/users/hasahmad/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hasahmad/subscriptions","organizations_url":"https://api.github.com/users/hasahmad/orgs","repos_url":"https://api.github.com/users/hasahmad/repos","events_url":"https://api.github.com/users/hasahmad/events{/privacy}","received_events_url":"https://api.github.com/users/hasahmad/received_events","type":"User","site_admin":false},"created_at":"2017-09-10T02:39:47Z","updated_at":"2017-09-10T02:39:47Z","author_association":"NONE","body":"I haven't used Loki.js for a while so I'm not sure if they've added a bulk insert functionality.\r\nBut you can do a for loop to insert to database.\r\nFor example:\r\n\r\n```\r\n    var db = new loki('contacts.json');\r\n    var collection = db.addCollection('contacts');\r\n    var data = data_fetched_from_api;\r\n    for (var i=0; i<data.length; i++) {\r\n        var contact = data[i];\r\n        collection.insert(contact);\r\n      }\r\n```"}}
{"actor":{"display_login":"hasahmad"}}