mirror of
https://github.com/cloudwu/skynet.git
synced 2026-07-24 20:23:06 +00:00
change api name bson.encode_order
This commit is contained in:
@@ -857,12 +857,12 @@ lencode(lua_State *L) {
|
||||
}
|
||||
|
||||
static int
|
||||
lencode_sorted(lua_State *L) {
|
||||
lencode_order(lua_State *L) {
|
||||
struct bson b;
|
||||
bson_create(&b);
|
||||
int n = lua_gettop(L);
|
||||
if (n%2 != 0) {
|
||||
return luaL_error(L, "Invalid sorted dict");
|
||||
return luaL_error(L, "Invalid ordered dict");
|
||||
}
|
||||
pack_sorted_dict(L, &b, n);
|
||||
lua_settop(L,1);
|
||||
@@ -1161,7 +1161,7 @@ luaopen_bson(lua_State *L) {
|
||||
}
|
||||
luaL_Reg l[] = {
|
||||
{ "encode", lencode },
|
||||
{ "encode_sorted", lencode_sorted },
|
||||
{ "encode_order", lencode_order },
|
||||
{ "date", ldate },
|
||||
{ "timestamp", ltimestamp },
|
||||
{ "regex", lregex },
|
||||
|
||||
@@ -6,7 +6,7 @@ local rawget = rawget
|
||||
local assert = assert
|
||||
|
||||
local bson_encode = bson.encode
|
||||
local bson_encode_sorted = bson.encode_sorted
|
||||
local bson_encode_order = bson.encode_order
|
||||
local bson_decode = bson.decode
|
||||
local empty_bson = bson_encode {}
|
||||
|
||||
@@ -182,9 +182,9 @@ function mongo_db:runCommand(cmd,cmd_v,...)
|
||||
local sock = conn.__sock
|
||||
local bson_cmd
|
||||
if not cmd_v then
|
||||
bson_cmd = bson_encode_sorted(cmd,1)
|
||||
bson_cmd = bson_encode_order(cmd,1)
|
||||
else
|
||||
bson_cmd = bson_encode_sorted(cmd,cmd_v,...)
|
||||
bson_cmd = bson_encode_order(cmd,cmd_v,...)
|
||||
end
|
||||
local pack = driver.query(request_id, 0, self.__cmd, 0, 1, bson_cmd)
|
||||
-- todo: check send
|
||||
|
||||
Reference in New Issue
Block a user