0

We are creating the Documents on couch base lite i need to know the format of document which stores in database to sync to server on mobile devices for example.

We create simple document:

com.couchbase.lite.Document document = database.createDocument();

 Map<String, Object> docContent = new HashMap<String, Object>();
    docContent.put("message", "Hello Couchbase Lite 1");
    docContent.put("name", "raheel");
    docContent.put("lastUpdated", this.date());

and then put the Document properties:

try {
    document.putProperties(docContent);
} catch (CouchbaseLiteException e) {
    e.printStackTrace();
}

so how the data is stored in that document ? in what format?

M.Raheel
  • 165
  • 7

2 Answers2

0

Couchbase stores the data in JSON format.

FireZenk
  • 1,056
  • 1
  • 16
  • 28
0

This will do just fine, no need for the hashmap

document.Put("message", "Hello Couchbase Lite 1");