From bd3d9b70ec297c30985a1c22e17c51329ca16429 Mon Sep 17 00:00:00 2001 From: Cloud Wu Date: Mon, 13 Jun 2016 12:05:52 +0800 Subject: [PATCH] change arg name --- lualib/mongo.lua | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lualib/mongo.lua b/lualib/mongo.lua index 977d4c3a..c33c8d6c 100644 --- a/lualib/mongo.lua +++ b/lualib/mongo.lua @@ -358,12 +358,12 @@ local function IndexModel(option) end -- collection:createIndex { { key1 = 1}, { key2 = 1 }, unique = true } -function mongo_collection:createIndex(option , onekey) - if onekey then - return createIndex_onekey(self, option, onekey) +function mongo_collection:createIndex(arg1 , arg2) + if arg2 then + return createIndex_onekey(self, arg1, arg2) + else + return self.database:runCommand("createIndexes", self.name, "indexes", { IndexModel(arg1) }) end - - return self.database:runCommand("createIndexes", self.name, "indexes", { IndexModel(option) }) end function mongo_collection:createIndexes(...)