{"action":"created","issue":{"url":"https://api.github.com/repos/tonsky/datascript/issues/73","labels_url":"https://api.github.com/repos/tonsky/datascript/issues/73/labels{/name}","comments_url":"https://api.github.com/repos/tonsky/datascript/issues/73/comments","events_url":"https://api.github.com/repos/tonsky/datascript/issues/73/events","html_url":"https://github.com/tonsky/datascript/issues/73","id":71964034,"number":73,"title":"d.init_db with schema from Javascript","user":{"login":"motosota","id":6562352,"avatar_url":"https://avatars.githubusercontent.com/u/6562352?v=3","gravatar_id":"","url":"https://api.github.com/users/motosota","html_url":"https://github.com/motosota","followers_url":"https://api.github.com/users/motosota/followers","following_url":"https://api.github.com/users/motosota/following{/other_user}","gists_url":"https://api.github.com/users/motosota/gists{/gist_id}","starred_url":"https://api.github.com/users/motosota/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/motosota/subscriptions","organizations_url":"https://api.github.com/users/motosota/orgs","repos_url":"https://api.github.com/users/motosota/repos","events_url":"https://api.github.com/users/motosota/events{/privacy}","received_events_url":"https://api.github.com/users/motosota/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-04-29T19:21:24Z","updated_at":"2015-04-30T15:29:17Z","closed_at":"2015-04-30T15:24:39Z","body":"Hi,\r\n\r\nI'm struggling to use d.init_db and create a schema at the same time like so:\r\n\r\nd.init_db([[1, \"name\", \"Ivan\"],[1, \"age\", 17],[2, \"name\", \"Igor\"],[2, \"age\", 35][1, \"friend\", 2]], [{\"friend\": {\":db/valueType\": \":db.type/ref\"}}]);\r\n\r\nGives \r\nError: nth not supported on this type function Object() { [native code] }\r\n\r\nWhat am I doing wrong?\r\n\r\nMike"},"comment":{"url":"https://api.github.com/repos/tonsky/datascript/issues/comments/97839335","html_url":"https://github.com/tonsky/datascript/issues/73#issuecomment-97839335","issue_url":"https://api.github.com/repos/tonsky/datascript/issues/73","id":97839335,"user":{"login":"tonsky","id":285292,"avatar_url":"https://avatars.githubusercontent.com/u/285292?v=3","gravatar_id":"","url":"https://api.github.com/users/tonsky","html_url":"https://github.com/tonsky","followers_url":"https://api.github.com/users/tonsky/followers","following_url":"https://api.github.com/users/tonsky/following{/other_user}","gists_url":"https://api.github.com/users/tonsky/gists{/gist_id}","starred_url":"https://api.github.com/users/tonsky/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tonsky/subscriptions","organizations_url":"https://api.github.com/users/tonsky/orgs","repos_url":"https://api.github.com/users/tonsky/repos","events_url":"https://api.github.com/users/tonsky/events{/privacy}","received_events_url":"https://api.github.com/users/tonsky/received_events","type":"User","site_admin":false},"created_at":"2015-04-30T15:29:16Z","updated_at":"2015-04-30T15:29:16Z","body":"It’s a bug in DS and also you shouldn’t wrap schema in Array. Correct code should be:\r\n```\r\nd.init_db([[1, \"name\", \"Ivan\"],\r\n            [1, \"age\", 17],\r\n            [2, \"name\", \"Igor\"],\r\n            [2, \"age\", 35],\r\n            [1, \"friend\", 2]],\r\n  {\"friend\": {\":db/valueType\": \":db.type/ref\"}});\r\n```\r\n"}}