File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed
Expand file tree Collapse file tree 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
2727local object_id_mt = obid .metatable
2828local binary_mt = {}
2929local utc_date = {}
30+ local bson_null = {}
3031
3132
3233local function read_document ( get , numerical )
@@ -68,7 +69,7 @@ local function read_document ( get , numerical )
6869 elseif op == " \9 " then -- UTC datetime milliseconds
6970 v = le_uint_to_num ( get ( 8 ) , 1 , 8 )
7071 elseif op == " \10 " then -- Null
71- v = nil
72+ v = bson_null
7273 elseif op == " \16 " then -- int32
7374 v = le_int_to_num ( get ( 4 ) , 1 , 8 )
7475 elseif op == " \17 " then -- int64
@@ -209,8 +210,9 @@ function to_bson(ob)
209210end
210211
211212return {
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 ;
214216 get_bin_data = get_bin_data ;
215217 get_utc_date = get_utc_date ;
216218}
Original file line number Diff line number Diff line change @@ -12,6 +12,8 @@ local connmethods = { }
1212local connmt = { __index = connmethods }
1313
1414local dbmt = require ( mod_name .. " .dbmt" )
15+ local bson = require ( mod_name .. " .bson" )
16+ null = bson .bson_null
1517
1618function connmethods :ismaster ()
1719 local db = self :new_db_handle (" admin" )
You can’t perform that action at this time.
0 commit comments