Ejemplo n.º 1
0
 /*
 ** Return MongoDocument of this element (you should check that this IS document before)
 */
 MongoDocumentPtr MongoElement::asDocument()
 {
     MongoDocument *doc = new MongoDocument(_bsonElement.Obj());
     return MongoDocumentPtr(doc);
 }
Ejemplo n.º 2
0
 /*
 ** Create MongoDocument from BsonObj. It will take owned version of BSONObj
 */ 
 MongoDocumentPtr MongoDocument::fromBsonObj(const mongo::BSONObj &bsonObj)
 {
     MongoDocument *doc = new MongoDocument(bsonObj);
     return MongoDocumentPtr(doc);
 }