From 1d5b9e3ca2df9a28d8d48766fae83502bc30f523 Mon Sep 17 00:00:00 2001 From: xiyoo0812 Date: Sat, 11 May 2024 23:21:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BA=A4=E6=B5=8B=E8=AF=95=E4=BB=A3?= =?UTF-8?q?=E7=A0=81?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- server/test/mongo_test.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/server/test/mongo_test.lua b/server/test/mongo_test.lua index 2ba5b813..1b1e4f1b 100644 --- a/server/test/mongo_test.lua +++ b/server/test/mongo_test.lua @@ -1,5 +1,6 @@ -- mongo_test.lua local log_debug = logger.debug +local bdate = bson.date local timer_mgr = quanta.get("timer_mgr") @@ -33,6 +34,11 @@ timer_mgr:once(2000, function() log_debug("db listIndexes code: {}, err = {}", icode, ierr) icode, ierr = mongo_mgr:drop_indexes("test_mongo_2", "test_uid") log_debug("db drop_indexes code: {}, err = {}", icode, ierr) + + icode, ierr = mongo_mgr:insert(primary_id, "test_mongo_1", {pid = 123457, uid = 3, time = quanta.now_ms, ttl = bdate(quanta.now + 30)}) + log_debug("db insert code: {}, err = {}", icode, ierr) + icode, ierr = mongo_mgr:create_indexes("test_mongo_1", {{key={pid,1,uid,1},name="test_uid", unique = true}}) + log_debug("db create_indexes code: {}, err = {}", icode, ierr) --[[ fcode, res = mongo_mgr:find("test_mongo_1", {}, {_id = 0}, {pid = 1})