Skip to content

Commit

Permalink
(fix)(ModelDocument)Get _id field directly from ViewIterator
Browse files Browse the repository at this point in the history
  • Loading branch information
hris2003 committed Jan 14, 2017
1 parent baf70b9 commit d7d7b39
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/db/model_utils.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -113,11 +113,10 @@ namespace object_recognition_core

while (view_iterator != ViewIterator::end())
{
const or_json::mObject & obj = (*view_iterator).fields();
// Compare the parameters to the input ones
Document doc;
doc.set_db(db);
doc.set_document_id(obj.find("_id")->second.get_str());
doc.set_document_id((*view_iterator).get_field<std::string>("_id"));
doc.load_fields();
model_documents.push_back(doc);

Expand All @@ -144,11 +143,10 @@ namespace object_recognition_core

while (view_iterator != ViewIterator::end())
{
const or_json::mObject & obj = (*view_iterator).fields();
// Compare the parameters to the input ones
Document doc;
doc.set_db(db);
doc.set_document_id(obj.find("_id")->second.get_str());
doc.set_document_id((*view_iterator).get_field<std::string>("_id"));
doc.load_fields();
model_documents.push_back(doc);

Expand Down

0 comments on commit d7d7b39

Please sign in to comment.