Skip to content

Instantly share code, notes, and snippets.

@erkanzileli
Created January 27, 2021 18:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save erkanzileli/4034fc6565c49f21f29abd34ebf3db82 to your computer and use it in GitHub Desktop.
Save erkanzileli/4034fc6565c49f21f29abd34ebf3db82 to your computer and use it in GitHub Desktop.
couchbase example with node.js
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