Ask coding questions

← Back to all posts
how to make register program in node.js?(using replit db)
exp1109

i need an exampleeeeeeeeeee
how to make register program in node?
i found replit db, actually replit db is one key-one value.
In fact, repldb is a one-key-one-value database.
How can I store multiple values ​​in one key and retrieve them?

Answered by xfinnbar [earned 5 cycles]
View Answer
Voters
exp1109
Comments
hotnewtop
xfinnbar

You can use an object as a value, then get properties from it.

exp1109
exp1109

@xfinnbar but i cant understand
can you give me some example?

xfinnbar

I don't know much Node, but take this for an example (this probably won't work but you can fix it):

@exp1109

exp1109

@xfinnbar oh thank you!

exp1109

@xfinnbar Hmm but the replit db in node.js doesn't seem to support arrays

xfinnbar

It does @exp1109

exp1109

@xfinnbar oh it works?

exp1109

@xfinnbar
This is really the last question.
I did as you taught, but it seems that the value is not saved in the DB. What should I do?

SixBeeps

Why would you want to store multiple values in one key?

The idea of the database is that each user has their own KVP, where their username or user ID is the key. Their password or account details would then be the value of that key.

exp1109

@SixBeeps There are multiple details