I think thats the reason the Model class is provided. But I am not sure about that. For e.g. say I define a class as such:
class MyModel : public mongo::Model
{
public:
virtual const char* getNS(); // Implemented by this class.
virtual void serialize(
BSONObjBuilder &to); // Implemented by this class. Pumps this class's member variables into the BOB.
virtual void unserialize(const
BSONObj &from); // Implemented by this class. Extracts data from the BOB and stores into this class's member variables.
virtual string modelServer(); // Implemented by this class.
private:
// Member variables representing data of this model.
};
Now, once I implement the MyModel class, how do I use it? And when and why should I use it? There is no example/document/tutorial explaining that.
Thanks and regards,
~Plug