Comparison

mod_storage_mongodb/mod_storage_mongodb.lua @ 813:2469f779b3f7

mod_storage_*: Update to use module:provides().
author Waqas Hussain <waqas20@gmail.com>
date Wed, 12 Sep 2012 23:58:01 +0500
parent 509:bf2ad6d6c778
child 1010:fd420237a5e4
comparison
equal deleted inserted replaced
812:0095b74a3685 813:2469f779b3f7
42 else -- delete data 42 else -- delete data
43 return conn:remove ( namespace , v ); 43 return conn:remove ( namespace , v );
44 end; 44 end;
45 end 45 end
46 46
47 local driver = { name = "mongodb" }; 47 local driver = {};
48 48
49 function driver:open(store, typ) 49 function driver:open(store, typ)
50 if not conn then 50 if not conn then
51 conn = assert ( mongo.Connection.New ( true ) ); 51 conn = assert ( mongo.Connection.New ( true ) );
52 assert ( conn:connect ( params.server ) ); 52 assert ( conn:connect ( params.server ) );
59 return setmetatable({ store = store }, keyval_store); 59 return setmetatable({ store = store }, keyval_store);
60 end; 60 end;
61 return nil, "unsupported-store"; 61 return nil, "unsupported-store";
62 end 62 end
63 63
64 module:add_item("data-driver", driver); 64 module:provides("storage", driver);