{"id":258,"date":"2016-09-24T07:54:21","date_gmt":"2016-09-23T22:54:21","guid":{"rendered":"http:\/\/blue-bear.jp\/kb\/?p=258"},"modified":"2016-09-24T09:02:37","modified_gmt":"2016-09-24T00:02:37","slug":"swiftfirebase-childbyautoid%e3%81%a7%e8%bf%bd%e5%8a%a0%e3%81%97%e3%81%9fid%e3%82%92%e5%8f%96%e5%be%97%e3%81%99%e3%82%8b","status":"publish","type":"post","link":"https:\/\/blue-bear.jp\/kb\/swiftfirebase-childbyautoid%e3%81%a7%e8%bf%bd%e5%8a%a0%e3%81%97%e3%81%9fid%e3%82%92%e5%8f%96%e5%be%97%e3%81%99%e3%82%8b\/","title":{"rendered":"[swift][firebase] childByAutoId\u3067\u8ffd\u52a0\u3057\u305fID\u3092\u53d6\u5f97\u3059\u308b"},"content":{"rendered":"<h2>childByAutoId\u3067\u8ffd\u52a0\u3057\u305fID\u3092\u53d6\u5f97\u3059\u308b<\/h2>\n<h3>DB\u306b\u66f8\u304d\u8fbc\u307f\u3057\u305f\u76f4\u5f8c<\/h3>\n<p>\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\uff1a<\/p>\n<pre>\r\nlet ref = FIRDatabase.database().reference().child(\"users\").child(user.uid).childByAutoId()\r\nlet autoid = ref.key \/\/autoID\u306eID\r\n<\/pre>\n<h3>DB\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3093\u3060\u3068\u304d<\/h3>\n<p>DB\u304b\u3089\u30c7\u30fc\u30bf\u3092\u8aad\u307f\u8fbc\u3093\u3060\u3068\u304d\u306eID\u306e\u8868\u793a\u306f\u4e0b\u8a18\u306e\u901a\u308a<br \/>\n\u30b5\u30f3\u30d7\u30eb\u30b3\u30fc\u30c9\uff1a<\/p>\n<pre>\r\nlet ref = FIRDatabase.database().reference().child(\"users\").child(user.uid)\r\nref.observeEventType(.Value, withBlock: { snapshot in\r\n    for child in snapshot.children {\r\n        let key = child.key as String\r\n        print(key)\r\n    }\r\n})\r\n\r\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>childByAutoId\u3067\u8ffd\u52a0\u3057\u305fID<\/p>\n","protected":false},"author":1,"featured_media":103,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[14,13],"tags":[],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/258"}],"collection":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/comments?post=258"}],"version-history":[{"count":3,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/258\/revisions"}],"predecessor-version":[{"id":263,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/posts\/258\/revisions\/263"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/media\/103"}],"wp:attachment":[{"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/media?parent=258"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/categories?post=258"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blue-bear.jp\/kb\/wp-json\/wp\/v2\/tags?post=258"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}