mardi 24 février 2015

mongo-cxx-driver iterators and getFieldDotted


Is there a way to initialize BSONObjIterator having only a BSONElement returned by getFieldDotted()?


Example data:



{ key_1 : { key_2 : [ 1, 2, 3 ] } }


I can do BSONObjIterator(p.getObjectField("key_1")), but i want something like: BSONObjIterator(p.getFieldDotted("key_1.key_2")) which won't work as getFieldDotted() returns BSONElement. I cannot figure how to get BSONObj using dotted notation.




Aucun commentaire:

Enregistrer un commentaire