rebridge icon indicating copy to clipboard operation
rebridge copied to clipboard

An advice

Open qqaimh opened this issue 6 years ago • 2 comments

Just an advice. The initialization of the rebridge is not safe. Just like below example code : ................................................................................................................................................................................................ const Rebridge = require("rebridge"); const redis = require("redis");

const client = redis.createClient(); const db = new Rebridge(client, { mode: "deasync" });

db.users = [ ]; // This is what I want to say ............................................................................................................................................................ If I put "db.users = [ ]" in my codes, I will worry about it may clean up the datas in the db.users. I think it should change to just like "InsertOrCreate", if the db.users exists, it will insert item into db.users; if the db.users does not exist, it will create the db.users, then insert item into the new db.users. ...................................................... Just an advice, Thank you.

qqaimh avatar May 18 '19 15:05 qqaimh

That's a good idea, I might implement it sometime. (If someone else wants to work on it, PRs welcome.)

CapacitorSet avatar May 21 '19 08:05 CapacitorSet

That's a good idea, I might implement it sometime. (If someone else wants to work on it, PRs welcome.)

I am glad to do something, but I am starting my own busssiness. So I am so busy to write many codes, If I succeeded , I think my company will need the people ,like you have great thoughts. I have to write codes..........

qqaimh avatar May 21 '19 17:05 qqaimh