Could you create a simple sqlite database with two columns:
==documents==
id|data
and data would be json data.
You could also create a key table which would be:
==keys==
keyname|keyvalue|id
that would be indexed on keyname and keyvalue for quick lookups.
A single db file could be a collection, and you could create multiple db files for multiple collections.
You could use folders as "dbs" to match mongodb's hierarchy of db->collection->document