{"action":"closed","issue":{"url":"https://api.github.com/repos/pouchdb/pouchdb/issues/5399","repository_url":"https://api.github.com/repos/pouchdb/pouchdb","labels_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/5399/labels{/name}","comments_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/5399/comments","events_url":"https://api.github.com/repos/pouchdb/pouchdb/issues/5399/events","html_url":"https://github.com/pouchdb/pouchdb/issues/5399","id":162184698,"number":5399,"title":"Getting Started with PouchDB","user":{"login":"ceremcem","id":6639874,"avatar_url":"https://avatars.githubusercontent.com/u/6639874?v=3","gravatar_id":"","url":"https://api.github.com/users/ceremcem","html_url":"https://github.com/ceremcem","followers_url":"https://api.github.com/users/ceremcem/followers","following_url":"https://api.github.com/users/ceremcem/following{/other_user}","gists_url":"https://api.github.com/users/ceremcem/gists{/gist_id}","starred_url":"https://api.github.com/users/ceremcem/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ceremcem/subscriptions","organizations_url":"https://api.github.com/users/ceremcem/orgs","repos_url":"https://api.github.com/users/ceremcem/repos","events_url":"https://api.github.com/users/ceremcem/events{/privacy}","received_events_url":"https://api.github.com/users/ceremcem/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":5,"created_at":"2016-06-24T16:36:29Z","updated_at":"2016-06-27T09:06:50Z","closed_at":"2016-06-27T09:06:50Z","body":"Well, it's not going well... The only [example code](https://github.com/nickcolley/getting-started-todo/issues/3) is not working. Independently of that example, I could manage to put some test documents and get all of them from database, that's all: \r\n\r\n```\r\nupdate-view = (...x) ->\r\n    console.log \"Change detected! : \", x\r\n    db.allDocs {include_docs: true, descending: true}, (err, doc) ->\r\n        console.log \"Docs: \", doc\r\n\r\ndb = new PouchDB \\mydb\r\nremote = 'https://MYUSER:MYPASS@MYUSER.cloudant.com/MYDB'\r\nopts =\r\n    continuous: yes\r\n    on-change: update-view\r\n\r\ndb.replicate.to remote, opts\r\ndb.replicate.from remote, opts\r\n\r\nuser-id = 5\r\nget-new-id = ->\r\n    timestamp = new Date!get-time! .to-string 16\r\n    \"#{user-id}-#{timestamp}\"\r\n\r\nproducts =\r\n    _id: get-new-id!\r\n    title: \\products\r\n    product-list:\r\n        * name: \\cake\r\n          unit: \\piece\r\n          best-served: \\cold\r\n        * name: \\water\r\n          unit: \\kg\r\n          best-served: \\hot\r\n\r\n\r\ndb.put products, (err, result) ->\r\n    if not err\r\n        console.log \"success!\"\r\n    console.log \"result: \", result\r\n```\r\n\r\nSecond step is getting a view value: \r\n\r\n```\r\n$ curl https://MYUSER:MYPASS@MYUSER.cloudant.com/MYDB/_design/getTitles/_view/new-view\r\n{\"total_rows\":7,\"offset\":0,\"rows\":[\r\n{\"id\":\"5-1557feee287\",\"key\":\"5-1557feee287\",\"value\":\"domates\"},\r\n{\"id\":\"5-1557ff6c0b3\",\"key\":\"5-1557ff6c0b3\",\"value\":\"domates\"},\r\n{\"id\":\"5-1557ff854f8\",\"key\":\"5-1557ff854f8\",\"value\":\"domates\"},\r\n{\"id\":\"5-1557fffff92\",\"key\":\"5-1557fffff92\",\"value\":\"domates\"},\r\n{\"id\":\"5-1558000c0d5\",\"key\":\"5-1558000c0d5\",\"value\":\"domates\"},\r\n{\"id\":\"5-1558000f067\",\"key\":\"5-1558000f067\",\"value\":\"domates\"},\r\n{\"id\":\"5-15582153a32\",\"key\":\"5-15582153a32\",\"value\":\"domates\"}\r\n]}\r\n```\r\n\r\nI can't figure out how to get this result via PouchDB. \r\n\r\nIsn't there any example for such a startup?"}}
{"actor":{"display_login":"daleharvey"}}