Created
January 27, 2021 18:48
-
-
Save erkanzileli/4034fc6565c49f21f29abd34ebf3db82 to your computer and use it in GitHub Desktop.
couchbase example with node.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const couchbase = require("couchbase"); | |
const cluster = new couchbase.Cluster("couchbase://hostname", { | |
username: "username", | |
password: "password", | |
}); | |
const bucket = cluster.bucket("bucket-name"); | |
const collection = bucket.defaultCollection(); | |
async function main() { | |
const document = await collection.get("id"); | |
document.content.property1 = "X"; | |
await collection.upsert("id", document.content); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment