Skip to content

Instantly share code, notes, and snippets.

@bhawna94
Created April 16, 2019 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bhawna94/1a7abcbb447d8ad3b74f6d2483d72b18 to your computer and use it in GitHub Desktop.
Save bhawna94/1a7abcbb447d8ad3b74f6d2483d72b18 to your computer and use it in GitHub Desktop.
//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