Ask coding questions

← Back to all posts
ReplDB (NodeJS) not returning keys or values
Teddy007

Fairly self explanatory based on the title, any ideas as to how to solve?

This is the code I'm using right now:

const Database = require("@replit/database")
const db = new Database()
db.set("key", "value")
if (db.get("key") == "key") {
console.log("Key found")
}

Answered by ruiwenge2 [earned 5 cycles]
View Answer
Voters
Teddy007
Comments
hotnewtop
ruiwenge2

db.get is a promise, so do this: