diff --git a/MongoDB/src/Database.cpp b/MongoDB/src/Database.cpp index 6300ecae3..76b8d31bd 100644 --- a/MongoDB/src/Database.cpp +++ b/MongoDB/src/Database.cpp @@ -156,7 +156,7 @@ bool Database::authCR(Connection& connection, const std::string& username, const if (response.documents().size() > 0) { Document::Ptr pDoc = response.documents()[0]; - if (pDoc->get("ok") != 1) return false; + if (pDoc->getInteger("ok") != 1) return false; nonce = pDoc->get("nonce", ""); if (nonce.empty()) throw Poco::ProtocolException("no nonce received"); } @@ -181,7 +181,7 @@ bool Database::authCR(Connection& connection, const std::string& username, const if (response.documents().size() > 0) { Document::Ptr pDoc = response.documents()[0]; - return pDoc->get("ok") == 1; + return pDoc->getInteger("ok") == 1; } else throw Poco::ProtocolException("empty response for authenticate"); } @@ -208,7 +208,7 @@ bool Database::authSCRAM(Connection& connection, const std::string& username, co if (response.documents().size() > 0) { Document::Ptr pDoc = response.documents()[0]; - if (pDoc->get("ok") == 1) + if (pDoc->getInteger("ok") == 1) { Binary::Ptr pPayload = pDoc->get("payload"); serverFirstMsg = pPayload->toRawString(); @@ -264,7 +264,7 @@ bool Database::authSCRAM(Connection& connection, const std::string& username, co if (response.documents().size() > 0) { Document::Ptr pDoc = response.documents()[0]; - if (pDoc->get("ok") == 1) + if (pDoc->getInteger("ok") == 1) { Binary::Ptr pPayload = pDoc->get("payload"); serverSecondMsg.assign(reinterpret_cast(pPayload->buffer().begin()), pPayload->buffer().size()); @@ -297,7 +297,7 @@ bool Database::authSCRAM(Connection& connection, const std::string& username, co if (response.documents().size() > 0) { Document::Ptr pDoc = response.documents()[0]; - return pDoc->get("ok") == 1; + return pDoc->getInteger("ok") == 1; } else throw Poco::ProtocolException("empty response for saslContinue"); }