I read your code in the stackoverflow’s post. Your code looks fine. First of all, we’d like to confirm that the data is stored correctly in the database file. If you are using Mac OS X, can you open the database file with Couchbase Lite Viewer (https://github.com/couchbaselabs/CouchbaseLiteViewer)? If not, could you switch storage engine to SQLite instead of ForestDB. To check the data, you could use SQLite command or tools.
I could not figure out how to make sense of the resulting sqlite database (I am on Ubuntu 14.10) by looking using the sqlitebrowser client. But I’ve checked in the database here so that you can take a look.
I am not familiar with Scala. It seems that the generating the nested Java Map/List could have the problem. Can you check if jsonMap.asJava generates appropriate Java Map instance with nested Java Map/List instancies?
Ah! That was indeed it. I was able to fix the code by recursively converting the scala map to a java map (using this tip) while writing to the database. Thanks very much for unblocking me, @hideki !