Details
-
Bug
-
Status: Resolved
-
Test Blocker
-
Resolution: Fixed
-
None
-
None
Description
Something along the lines of this, with best practices, if possible (I'm not a Node expert, can't offer that):
======
'use strict';
var couchbase = require('couchbase');
// Create a Couchbase Cluster connection
var cluster = new couchbase.Cluster('couchbase://localhost',
);
// Open a specific Couchbase bucket, `travel-sample` in this case.
var bucket = cluster.bucket('travel-sample');
// And select the default collection
var collection = bucket.defaultCollection();
// upsert document
async function upsertDocument(key, value)
upsertDocument("my-document",
{name: 'mike'});
// get document
async function getDocument()
{
await collection.get('airline_10123', function(err, result)
);
}
getDocument();
=======
If someone tries to use our current example, they won't get far. It's pretty frustrating.
Reporter: Oleg Kuzmin
E-mail: oleg.kuzmin@couchbase.com
Attachments
Activity
Field | Original Value | New Value |
---|---|---|
Assignee | Amarantha Kulkarni [ amarantha.kulkarni ] | Richard Smedley [ richard smedley ] |
Component/s | server dev guide and SDKs [ 11814 ] | |
Epic Link | CBD-2844 [ 96901 ] | |
Sprint |
|
|
Labels | collector-de2e9313 | collector-de2e9313 node.js |
Priority | Test Blocker [ 6 ] |
Status | Open [ 1 ] | In Progress [ 3 ] |
Resolution | Fixed [ 1 ] | |
Status | In Progress [ 3 ] | Resolved [ 5 ] |
Hi Oleg,
I hope that the reworked example in https://docs.couchbase.com/nodejs-sdk/3.0/hello-world/start-using-sdk.html does the trick.