Permalink
Browse files

upgrade to mongo-c-driver 0.7

  • Loading branch information...
1 parent 7288577 commit 48850eb87836c2b3283f8d1f8554cde91e05d75a @gerald-lindsly committed Dec 22, 2012
View
Binary file not shown.
View
@@ -1,8 +1,8 @@
Package: rmongodb
Type: Package
Title: R-MongoDB driver
-Version: 1.0.3
-Date: 2012-3-5
+Version: 1.0.4
+Date: 2012-12-22
Author: Gerald Lindsly & 10gen, Inc. (mongo-c-driver)
Maintainer: Gerald Lindsly <gerald.lindsly@gmail.com>
Description: Provides an interface to MongoDB for R
@@ -12,8 +12,8 @@ Provides an interface to MongoDB for R
\tabular{ll}{
Package: \tab rmongodb\cr
Type: \tab Package\cr
-Version: \tab 1.0.3\cr
-Date: \tab 2012-3-5\cr
+Version: \tab 1.0.4\cr
+Date: \tab 2012-12-22\cr
License: \tab Apache License 2.0\cr
LazyLoad: \tab yes\cr
}
View
@@ -20,7 +20,7 @@
#include "api_mongo.h"
#include "api_gridfs.h"
#include "symbols.h"
-#include "net.h"
+#include "env.h"
static const R_CallMethodDef callMethods[] = {
{ ".mongo.create", (DL_FUNC) mmongo_create, 0 },
@@ -168,11 +168,11 @@ static void _err_handler(const char* errmsg) {
void attribute_visible R_init_rmongodb(DllInfo *dll) {
R_registerRoutines(dll, NULL, callMethods, NULL, NULL);
- mongo_sock_init();
+ mongo_env_sock_init();
install_mongo_symbols();
bson_malloc_func = _malloc;
bson_realloc_func = _realloc;
- bson_free = _free;
+ bson_free_func = _free;
bson_printf = (bson_printf_func)Rprintf;
bson_errprintf = (bson_printf_func)REprintf;
set_bson_err_handler(_err_handler);
View
@@ -13,7 +13,7 @@
limitations under the License.
*/
#include <R.h>
-#include "net.h"
+#include "env.h"
#include "api_mongo.h"
#include "api_bson.h"
#include "symbols.h"
@@ -63,7 +63,7 @@ SEXP rmongo_connect(SEXP mongo_conn) {
if (name[0] == '\0') {
for (i = 0; i < len; i++) {
mongo_parse_host(CHAR(STRING_ELT(host, i)), &hp);
- if (mongo_connect(conn, hp.host, hp.port) == MONGO_OK)
+ if (mongo_client(conn, hp.host, hp.port) == MONGO_OK)
break;
}
if (i == len) {
@@ -174,7 +174,7 @@ SEXP rmongo_insert(SEXP mongo_conn, SEXP ns, SEXP b) {
SEXP ret;
PROTECT(ret = allocVector(LGLSXP, 1));
bson* _b = _checkBSON(b);
- LOGICAL(ret)[0] = (mongo_insert(conn, _ns, _b) == MONGO_OK);
+ LOGICAL(ret)[0] = (mongo_insert(conn, _ns, _b, 0) == MONGO_OK);
UNPROTECT(1);
return ret;
}
@@ -199,7 +199,7 @@ SEXP rmongo_insert_batch(SEXP mongo_conn, SEXP ns, SEXP b) {
blist[i] = _checkBSON(_b);
}
if (success)
- LOGICAL(ret)[0] = (mongo_insert_batch(conn, _ns, blist, len) == MONGO_OK);
+ LOGICAL(ret)[0] = (mongo_insert_batch(conn, _ns, (const bson**)blist, len, 0, 0) == MONGO_OK);
Free(blist);
if (!success)
error("Expected list of mongo.bson class objects");
@@ -220,7 +220,7 @@ SEXP rmongo_update(SEXP mongo_conn, SEXP ns, SEXP cond, SEXP op, SEXP flags) {
_flags |= INTEGER(flags)[i];
SEXP ret;
PROTECT(ret = allocVector(LGLSXP, 1));
- LOGICAL(ret)[0] = (mongo_update(conn, _ns, _cond, _op, _flags) == MONGO_OK);
+ LOGICAL(ret)[0] = (mongo_update(conn, _ns, _cond, _op, _flags, 0) == MONGO_OK);
UNPROTECT(1);
return ret;
}
@@ -232,7 +232,7 @@ SEXP rmongo_remove(SEXP mongo_conn, SEXP ns, SEXP cond) {
bson* _cond = _checkBSON(cond);
SEXP ret;
PROTECT(ret = allocVector(LGLSXP, 1));
- LOGICAL(ret)[0] = (mongo_remove(conn, _ns, _cond) == MONGO_OK);
+ LOGICAL(ret)[0] = (mongo_remove(conn, _ns, _cond, 0) == MONGO_OK);
UNPROTECT(1);
return ret;
}
@@ -396,7 +396,6 @@ SEXP mongo_command(SEXP mongo_conn, SEXP db, SEXP command) {
bson* _command = _checkBSON(command);
bson out;
if (mongo_run_command(conn, _db, _command, &out) != MONGO_OK) {
- bson_destroy(&out);
return R_NilValue;
}
SEXP ret = _mongo_bson_create(&out);
@@ -550,7 +549,7 @@ SEXP mmongo_get_primary(SEXP mongo_conn) {
SEXP mongo_get_hosts(SEXP mongo_conn) {
mongo* conn = _checkMongo(mongo_conn);
- mongo_replset* r = conn->replset;
+ mongo_replica_set* r = conn->replica_set;
if (!r) return R_NilValue;
int count = 0;
mongo_host_port* hp;

0 comments on commit 48850eb

Please sign in to comment.