CapacitorSet / rebridge

A transparent Javascript interface to Redis.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

An advice

qqaimh opened this issue · 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.

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

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..........