MongoDB in Java

25 views
Skip to first unread message

Drashti Pandya

unread,
Jul 12, 2015, 11:59:06 AM7/12/15
to mongod...@googlegroups.com
I'm new to mongoDB.I have JavaFx desktop application.How can I add data into mongoDb which are not JSON Data?

Stephen Steneker

unread,
Jul 13, 2015, 1:36:33 AM7/13/15
to mongod...@googlegroups.com, drashti...@gmail.com
On Monday, 13 July 2015 01:59:06 UTC+10, Drashti Pandya wrote:
I'm new to mongoDB.I have JavaFx desktop application.How can I add data into mongoDb which are not JSON Data?

Hi Drashti,

The MongoDB Java driver (and all MongoDB drivers) actually send data to the server in BSON format. BSON (short for "Binary JSON") is a JSON-like serialization that supports further data types that are not part of the JSON spec (see: http://bsonspec.org). There is no strict requirement to use JSON for your source data.

With the Java 3.0 driver there is a Document class you can use to insert new documents into your database. There are helper methods for parsing document data from (and to) JSON strings, but you can also populate keys/values using data you've parsed from another format.


Regards,
Stephen

Reply all
Reply to author
Forward
0 new messages