mirror of
https://github.com/mongodb/mongo.git
synced 2024-12-01 09:32:32 +01:00
27 lines
700 B
C++
27 lines
700 B
C++
// stragegy.cpp
|
|
|
|
#include "stdafx.h"
|
|
#include "request.h"
|
|
#include "../client/connpool.h"
|
|
#include "../db/commands.h"
|
|
|
|
namespace mongo {
|
|
|
|
void Strategy::doWrite( int op , Request& r , string server ){
|
|
ScopedDbConnection dbcon( server );
|
|
DBClientBase &_c = dbcon.conn();
|
|
|
|
/* TODO FIX - do not case and call DBClientBase::say() */
|
|
DBClientConnection&c = dynamic_cast<DBClientConnection&>(_c);
|
|
c.port().say( r.m() );
|
|
|
|
dbcon.done();
|
|
}
|
|
|
|
void Strategy::insert( string server , const char * ns , const BSONObj& obj ){
|
|
ScopedDbConnection dbcon( server );
|
|
dbcon->insert( ns , obj );
|
|
dbcon.done();
|
|
}
|
|
}
|