| 1196 | } |
| 1197 | |
| 1198 | ExtMsgDelete::ExtMsgDelete(ExtMsgHeader* header, const uint8_t* body) : header(header) { |
| 1199 | const uint8_t* ptr = body; |
| 1200 | const uint8_t* eom = (const uint8_t*)header + header->messageLength; |
| 1201 | |
| 1202 | // Mongo OP_DELETE begins with int32 ZERO, reserved for future use |
| 1203 | ptr += sizeof(int32_t); |
| 1204 | |
| 1205 | const char* collName = (const char*)ptr; |
| 1206 | ptr += strlen(collName) + 1; |
| 1207 | ns = getDBCollectionPair(collName, std::make_pair("msgType", "OP_DELETE")); |
| 1208 | |
| 1209 | flags = *(int32_t*)ptr; |
| 1210 | ptr += sizeof(int32_t); |
| 1211 | |
| 1212 | bson::BSONObj selector = bson::BSONObj((const char*)ptr); |
| 1213 | ptr += selector.objsize(); |
| 1214 | |
| 1215 | // If 0th bit is set, limit should be just one document or all documents (0). |
| 1216 | selectors.push_back(BSON("q" << selector << "limit" << (flags & 1))); |
| 1217 | |
| 1218 | ASSERT(ptr == eom); |
| 1219 | } |
| 1220 | |
| 1221 | std::string ExtMsgDelete::toString() { |
| 1222 | std::ostringstream stringStream; |
nothing calls this directly
no test coverage detected