Collection col = getCollection((String) message.get(COLLECTION));
if (obj instanceof byte[]) {
id = col.insertBinary(id, (byte[])obj).toString();
} else {
Document doc = DOMParser.toDocument((String) obj);
id = col.insertDocument(id, doc).toString();
}
Hashtable result = new Hashtable();
result.put(RESULT, id);
return result;