File tree 2 files changed +7
-3
lines changed
2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -27,6 +27,7 @@ local new_object_id = obid.new
27
27
local object_id_mt = obid .metatable
28
28
local binary_mt = {}
29
29
local utc_date = {}
30
+ local bson_null = {}
30
31
31
32
32
33
local function read_document ( get , numerical )
@@ -68,7 +69,7 @@ local function read_document ( get , numerical )
68
69
elseif op == " \9 " then -- UTC datetime milliseconds
69
70
v = le_uint_to_num ( get ( 8 ) , 1 , 8 )
70
71
elseif op == " \10 " then -- Null
71
- v = nil
72
+ v = bson_null
72
73
elseif op == " \16 " then -- int32
73
74
v = le_int_to_num ( get ( 4 ) , 1 , 8 )
74
75
elseif op == " \17 " then -- int64
@@ -209,8 +210,9 @@ function to_bson(ob)
209
210
end
210
211
211
212
return {
212
- from_bson = from_bson ;
213
- to_bson = to_bson ;
213
+ from_bson = from_bson ;
214
+ to_bson = to_bson ;
215
+ bson_null = bson_null ;
214
216
get_bin_data = get_bin_data ;
215
217
get_utc_date = get_utc_date ;
216
218
}
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ local connmethods = { }
12
12
local connmt = { __index = connmethods }
13
13
14
14
local dbmt = require ( mod_name .. " .dbmt" )
15
+ local bson = require ( mod_name .. " .bson" )
16
+ null = bson .bson_null
15
17
16
18
function connmethods :ismaster ()
17
19
local db = self :new_db_handle (" admin" )
You can’t perform that action at this time.
0 commit comments