{"action":"created","issue":{"url":"https://api.github.com/repos/vert-x3/vertx-mongo-client/issues/10","labels_url":"https://api.github.com/repos/vert-x3/vertx-mongo-client/issues/10/labels{/name}","comments_url":"https://api.github.com/repos/vert-x3/vertx-mongo-client/issues/10/comments","events_url":"https://api.github.com/repos/vert-x3/vertx-mongo-client/issues/10/events","html_url":"https://github.com/vert-x3/vertx-mongo-client/issues/10","id":79396383,"number":10,"title":"Can not save document.","user":{"login":"alober2","id":10446157,"avatar_url":"https://avatars.githubusercontent.com/u/10446157?v=3","gravatar_id":"","url":"https://api.github.com/users/alober2","html_url":"https://github.com/alober2","followers_url":"https://api.github.com/users/alober2/followers","following_url":"https://api.github.com/users/alober2/following{/other_user}","gists_url":"https://api.github.com/users/alober2/gists{/gist_id}","starred_url":"https://api.github.com/users/alober2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alober2/subscriptions","organizations_url":"https://api.github.com/users/alober2/orgs","repos_url":"https://api.github.com/users/alober2/repos","events_url":"https://api.github.com/users/alober2/events{/privacy}","received_events_url":"https://api.github.com/users/alober2/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2015-05-22T10:28:49Z","updated_at":"2015-05-30T03:17:33Z","closed_at":null,"body":"I try it, but can not save document.\r\nimport io.vertx.groovy.ext.mongo.MongoClient;\r\ndef options = [\r\n\tconfig:[\r\n\t\t\"host\": \"127.0.0.1\",\r\n\t\t\"port\": 27017,\r\n\t\t\"pool_size\": 15,\r\n\t\t\"db_name\": \"test_bug\"\r\n\t]\r\n]\r\n\r\ndef client = MongoClient.createShared(vertx, options.config);\r\ndef document = [\r\n\t_id: 1234,\r\n\ttitle: \"Language\"\r\n]\r\nclient.insert(\"bug_test\", document, { res ->\r\n\tif (res.succeeded()) {\r\n\t\tdef id = res.result()\r\n\t\tprintln(\"Inserted book with id ${id}\")\r\n\t} else {\r\n\t\tres.cause().printStackTrace()\r\n\t}\r\n});"},"comment":{"url":"https://api.github.com/repos/vert-x3/vertx-mongo-client/issues/comments/106980212","html_url":"https://github.com/vert-x3/vertx-mongo-client/issues/10#issuecomment-106980212","issue_url":"https://api.github.com/repos/vert-x3/vertx-mongo-client/issues/10","id":106980212,"user":{"login":"alober2","id":10446157,"avatar_url":"https://avatars.githubusercontent.com/u/10446157?v=3","gravatar_id":"","url":"https://api.github.com/users/alober2","html_url":"https://github.com/alober2","followers_url":"https://api.github.com/users/alober2/followers","following_url":"https://api.github.com/users/alober2/following{/other_user}","gists_url":"https://api.github.com/users/alober2/gists{/gist_id}","starred_url":"https://api.github.com/users/alober2/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/alober2/subscriptions","organizations_url":"https://api.github.com/users/alober2/orgs","repos_url":"https://api.github.com/users/alober2/repos","events_url":"https://api.github.com/users/alober2/events{/privacy}","received_events_url":"https://api.github.com/users/alober2/received_events","type":"User","site_admin":false},"created_at":"2015-05-30T03:17:33Z","updated_at":"2015-05-30T03:17:33Z","body":"Hi, I write a java file to do that. it show java.lang.ClassCastException: java.lang.Integer cannot be cast to java.lang.CharSequence\r\n// vertx run Server.java\r\n\r\nimport io.vertx.ext.mongo.MongoClient;\r\nimport java.util.*;\r\nimport io.vertx.core.json.*;\r\nimport io.vertx.core.AbstractVerticle;\r\n\r\npublic class Server extends AbstractVerticle {\r\n    public void start() {\r\n        JsonObject config = new JsonObject();\r\n        config.put(\"host\", \"127.0.0.1\");\r\n        config.put(\"port\", 27017);\r\n        config.put(\"db_name\", \"bug_test\");\r\n        MongoClient client = MongoClient.createShared(vertx, config);\r\n        JsonObject document = new JsonObject().put(\"title\", \"The Hobbit\");\r\n        // here it happened\r\n        document.put(\"_id\", 123456);\r\n\r\n        client.insert(\"bug_test\", document, res -> {\r\n            if (res.succeeded()) {\r\n                String id = res.result();\r\n                System.out.println(\"Inserted with id \" + id);\r\n            } else {\r\n                res.cause().printStackTrace();\r\n            }\r\n        });\r\n    }\r\n}"}}