Skip to content

Instantly share code, notes, and snippets.

@oznus
Last active August 29, 2015 14:17
Show Gist options
  • Select an option

  • Save oznus/c00516b4659ff191b723 to your computer and use it in GitHub Desktop.

Select an option

Save oznus/c00516b4659ff191b723 to your computer and use it in GitHub Desktop.
Saving Couchbase Lite document
Document userDocument = database.createDocument();
List<String> emails = new ArrayList<String>() {{
add("some_mail_1@gmai.com");
add("some_mail_2@gmai.com");
}
};
Map<String, Object> userMapper = new HashMap<>();
userMapper.put("name", "Justin");
userMapper.put("sureName", "Timberlake");
userMapper.put("description", "I like to write songs");
userMapper.put("emails",emails);
try {
userDocument.putProperties(userMapper);
} catch (CouchbaseLiteException e) {
Log.d(TAG,e.getMessage());
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment