Skip to content

Commit

Permalink
FIX registrationsQuery() implementation (some ftest may still fail)
Browse files Browse the repository at this point in the history
  • Loading branch information
fgalan committed Aug 28, 2024
1 parent 77a700d commit 24a4ba1
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/lib/mongoBackend/MongoGlobal.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1995,20 +1995,22 @@ bool registrationsQuery

LM_T(LmtMongo, ("retrieved document [%d]: '%s'", docs, r.toString().c_str()));

std::vector<orion::BSONElement> queryContextRegistrationV = getFieldF(r, REG_CONTEXT_REGISTRATION).Array();
//std::vector<orion::BSONElement> queryContextRegistrationV = getFieldF(r, REG_CONTEXT_REGISTRATION).Array();
std::string format = getStringFieldF(r, REG_FORMAT);
//ProviderFormat providerFormat = (format.empty())? PfJson : (format == "JSON")? PfJson : PfV2; FIXME PR
std::string regId = getFieldF(r, "_id").OID();

for (unsigned int ix = 0 ; ix < queryContextRegistrationV.size(); ++ix)
{
//for (unsigned int ix = 0 ; ix < queryContextRegistrationV.size(); ++ix)
//{
//processContextRegistrationElement(queryContextRegistrationV[ix].embeddedObject(), enV, attrL, crrV, mimeType, providerFormat, regId);
ngsiv2::Registration reg;
if (reg.fromBson(queryContextRegistrationV[ix].embeddedObject()))
//if (reg.fromBson(queryContextRegistrationV[ix].embeddedObject()))
if (reg.fromBson(r))
{
// FIXME PR: controll error if Registration comes from NGSIv1
regV->push_back(reg);
}
}
//}

/* FIXME: note that given the response doesn't distinguish from which registration ID the
* response comes, it could have that we have same context registration elements, belong to different
Expand Down

0 comments on commit 24a4ba1

Please sign in to comment.