2

hello i have this in the data explorer on the webinterface but i have a error

code:

r.db("discordboatsclubv1").table("users").get("355995885085392896").insert({
  "admin":"true"
})

error:

e: Expected type TABLE but found SINGLE_SELECTION: { "badges": [], "createdAt": 1573923739827, "discordAT": "94GXMoWf1Anhn5neKsV2o4nWS9HVFS", "discordRT": "akv9HS1nY9dqP9dfXou8jpNowv2Gw5", "id": "355995885085392896" } in: r.db("discordboatsclubv1").table("users").get("355995885085392896").insert({"admin": "true"}) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

screen

HiiZun
  • 27
  • 6

1 Answers1

2

When you call the .get you are accessing to a single document with that id. From there you can only insert additional element with an update statement:

r.db("discordboatsclubv1").table("users").get("355995885085392896").update({
  "admin":"true"
})
taygetos
  • 3,005
  • 2
  • 21
  • 29
  • thanks it's works ! but i have another error when i go to the webpage https://imgur.com/a/3xtH9bd – HiiZun Nov 21 '19 at 20:08
  • what webpage are we talking about? – taygetos Nov 21 '19 at 22:58
  • the website use a database so i have added a document in database to be are admin and when i go to a part i have that (i use https://github.com/discordboats-club/website) – HiiZun Nov 22 '19 at 11:40
  • add another question where you describe what are you trying to achieve, what tools you are using and how, and whats blocking you. – taygetos Nov 22 '19 at 11:48
  • in fact after having admin on the database and going into the staff part of the site I have this error https://imgur.com/a/3xtH9bd – HiiZun Nov 23 '19 at 21:11