My Code to write into the database:
rdb.ref(`users/${userid}`).update({
name : username,
`${mystring}` : 1,
`${mystring2}` : 2
});
The connection and the writing works, but only the first line. In JavaScript the Syntax to pass a variable to a String should be :
`string${variable}`
Am I wrong or is this a bug?
Like @Jeremy said, Strings need brackets around:
rdb.ref(`users/${userid}`).update({
name : username,
[`${mystring}`] : 1,
[`${mystring2}`] : 2
});