I’m currently learning the BSON java library for mongodb and I’m trying to transform a org.bson.BSONObject into XML in order to transform it with a XSLT stylesheet.
What kind of java types can I find as values in a BSONObject from a Mongodb ? Of course there will be:
- BSONObject (internal doc)
- java.lang.String
- ???
what are the others ? BigDecimal and BigInteger ? boolean, int, long, double ? Timestamp.. etc… ??
thanks,
Pierre
Had to search for it too, but according to this mongodb-dev post mapping is done like this:
This article on mongodb.org is a good resource for it, too.
Edit: Had a look at the source: org.bson.types.* is having a number of classes for BSON types. org.bson.BSONDecoder is decoding a BSON string and does the mapping listed above.