Created
April 16, 2019 10:28
-
-
Save bhawna94/1a7abcbb447d8ad3b74f6d2483d72b18 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//create JSONObject containing employee details | |
JsonObject jsonObject = JsonObject.create() | |
.put("emplId", "1") | |
.put("empName", "ABC"); | |
//create JSONDocument object containing Id and the content(employee details) | |
JsonDocument jsonDocument = JsonDocument.create(id, jsonObject); | |
//Add document to the bucket using insert method | |
JsonDocument doc = bucket.insert(jsonDocument); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment