ProxyMongoUpdateOne

 

MongoDB에서 해당하는 첫번째 항목을 업데이트한다.

MongoDB를 사용하려면 ProxyMongoDB.exe 프로그램이 실행되어 있어야 한다. (  http://files.autobase.biz/FileDownLoad/FileDownLoad.aspx?Folder=Proxy )

 

int @ProxyMongoUpdateOne(int connection_id, string collection_name, string filter, string update_text);

 

함수인자

int connection_id : 접속된 연결 ID

string collection_name : Collection 명

string filter : 필터 문장 (JSON Text)

string update_text : 업데이트 문장 (JSON Text)

 

반환 값

성공하면 1을 반환하고 실패하면 0을 반환한다.

 

예제

connection_id = @ProxyMongoOpen("mongodb://192.168.1.149", "test");
if(connection_id == 0)
{
   @Message("Error. connection_id == 0");
   return;
}

string filter,
string update;
@sprintf(filter, "{PersonCount:50}");
@sprintf(update, "{ $set:{PersonCount:55} }");

int retn;

retn = @ProxyMongoUpdateOne(connection_id, "things", filter, update);
@ProxyMongoClose(connection_id);
if(retn == 0){
   @MessageBox(@GetLastError(), "MongoUpdateOne Error", MB_OK);
   return;
}

 

문장설명 : 192.168.1.149 IP의 test 데이터베이스를 열어서 사용하는 예제

 

버전정보

최초지원: 10.3.5

 

관련항목

@ProxyMongoClose()

@ProxyMongoDeleteMany()

@ProxyMongoDeleteOne()

@ProxyMongoFill()

@ProxyMongoInsert()

@ProxyMongoOpen()

@ProxyMongoUpdateMany()

@ProxyMongoUpdateOne()