MongoDB를 Open한다.
MongoDB를 사용하려면 ProxyMongoDB.exe 프로그램이 실행되어 있어야 한다. ( http://files.autobase.biz/FileDownLoad/FileDownLoad.aspx?Folder=Proxy )
int @ProxyMongoOpen(string connection_string, string database_name);
함수인자
string connection_string : 접속할 연결 URL
string database_name : 접속할 데이터베이스명
반환 값
성공하면 0보다 큰값을 반환하고 실패하면 0을 반환한다.
예제
connection_id = @ProxyMongoOpen("mongodb://192.168.1.149", "test");
if(connection_id == 0)
{
@Message("Error. connection_id ==
0");
return;
}
object t = @DateTimeNow();
int year
= @DateTimeYear(t);
int month = @DateTimeMonth(t);
int day =
@DateTimeDay(t);
int hour = @DateTimeHour(t);
int minute =
@DateTimeMinute(t);
int second = @DateTimeSecond(t);
int millisecond =
@DateTimeMillisecond(t);
string time_string;
@sprintf(time_string,
"%04d-%02d-%02dT%02d:%02d:%02d.%03dZ", year, month, day, hour, minute, second,
millisecond);
string text;
int count = 50;
@sprintf(text,
"{PersonDate:ISODate('%s'), PersonCount:%d, PersonText:'Text'}", time_string
,count);
int retn;
retn = @ProxyMongoInsert(connection_id, "things",
text);
@ProxyMongoClose(connection_id);
if(retn == 0){
@MessageBox(@GetLastError(), "MongoInsert Error", MB_OK);
return;
}
문장설명 : 192.168.1.149 IP의 test 데이터베이스를 열어서 사용하는 예제
버전정보
최초지원: 10.3.5
관련항목