Skip to content

Commit d558ac0

Browse files
committed
Moves to canonical extended JSON where possible.
Signed-off-by: Aaron Jacobs <[email protected]>
1 parent 471fa2d commit d558ac0

File tree

3 files changed

+3
-3
lines changed

3 files changed

+3
-3
lines changed

src/bson.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ SEXP R_raw_to_bson(SEXP buf){
4444
}
4545

4646
SEXP R_bson_to_json(SEXP ptr){
47-
return mkStringUTF8(bson_as_json (r2bson(ptr), NULL));
47+
return mkStringUTF8(bson_as_canonical_extended_json (r2bson(ptr), NULL));
4848
}
4949

5050
SEXP R_bson_to_raw(SEXP ptr){

src/cursor.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ SEXP R_mongo_cursor_next_json (SEXP ptr, SEXP n){
6767
break;
6868
} else {
6969
size_t jsonlength;
70-
char *str = bson_as_json ((bson_t*) b, &jsonlength);
70+
char *str = bson_as_canonical_extended_json ((bson_t*) b, &jsonlength);
7171
SET_STRING_ELT(out, total, mkCharLenCE(str, jsonlength, CE_UTF8));
7272
if(str) bson_free(str);
7373
total++;

src/utils.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ SEXP bson_to_str(const bson_t * b){
1616
if(b == NULL)
1717
return ScalarString(NA_STRING);
1818
size_t jsonlength;
19-
char *str = bson_as_json(b, &jsonlength);
19+
char *str = bson_as_canonical_extended_json(b, &jsonlength);
2020
if(str == NULL)
2121
return ScalarString(NA_STRING);
2222
SEXP out = ScalarString(mkCharLenCE(str, jsonlength, CE_UTF8));

0 commit comments

Comments
 (0)