Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

A bridge between MongoDB DBObject and org.json.JSONObject?

I'm using the native MongoDB driver and API, which uses com.mongodb.DBObject to represent JSON objects, however for general purpose I have usage of org.json.JSONOBject.

I thought of replacing it and using DBObject as a general JSON library, but it doesn't feel right.

But to interop with the two, the low level String/Map format/parse interface is used, which I don't like either.

Is there a known library out there that implements both interfaces for easier interoperability?

like image 434
Eran Medan Avatar asked Nov 13 '22 20:11

Eran Medan


1 Answers

In general, converting between BSON and JSON was intended to be a painless operation, so you shouldn't have to write more classes. Does this answer help at all?

like image 108
shelman Avatar answered Nov 15 '22 11:11

shelman