# Poco::MongoDB

# class Message

Library: MongoDB
Package: MongoDB
Header: Poco/MongoDB/Message.h

## Description

Base class for all messages send or retrieved from MongoDB server.

INTERNAL: This is a base class for OpMsgMessage and not intended for direct use. Use OpMsgMessage instead.

## Inheritance

Known Derived Classes: OpMsgMessage

## Member Summary

Member Functions: header, messageLength

## Constructors

### Message

explicit Message(
MessageHeader::OpCode opcode
);

Creates a Message using the given OpCode.

## Destructor

### ~Message

virtual ~Message();

Destructor

## Member Functions

### header

[[nodiscard]]
MessageHeader & header();

Returns the message header

### messageLength

void messageLength(
Poco::Int32 length
);

Sets the message length in the message header

## Variables

### _header

MessageHeader _header;