Uploaded image for project: 'Couchbase node.js Client Library'
  1. Couchbase node.js Client Library
  2. JSCBC-1124

Update configuration profile implementation

    XMLWordPrintable

Details

    • Bug
    • Resolution: Fixed
    • Major
    • 4.2.1
    • None
    • None
    • None
    • 0

    Description

      Code: 

      const couchbase = require('couchbase')
      const main = async () => {  const cluster = await couchbase.connect('couchbases://cb.3c28ba8gdztn4hgi.cloud.couchbase.com', {    username: 'Administrator', password: 'Password'  })  const bucket = cluster.bucket('travel-sample')  const collection = bucket.defaultCollection()
        const getSubDocument = async (key, field) => {    try {      var result = await collection.lookupIn(key, [        couchbase.LookupInSpec.get(field),      ])      var fieldValue = result.content[0].value
            console.log('LookupIn Result: ')      console.log(result)
            console.log(`Field Value: `)      console.log(fieldValue)    } catch (error) {      console.error(error)    }  }
        getSubDocument('airline_10', 'country')    .then(() => process.exit(0))}
      main()
       

       

      Output: 

      LookupIn Result: 
      LookupInResult {
        content: [ LookupInResultEntry { error: null, value: 'Canada' } ],
        cas: Cas<1666527479337189376>
      }
      Field Value: 
      Canada 

      But when I am trying to do the same with WAN Profile 

      Code:

      const couchbase = require('couchbase')
      const main = async () => {  const cluster = await couchbase.connect('couchbases://cb.3c28ba8gdztn4hgi.cloud.couchbase.com', {    username: 'Administrator', password: 'Password'  })  cluster.applyProfile('wanDevelopment')  const bucket = cluster.bucket('travel-sample')  const collection = bucket.defaultCollection()
        const getSubDocument = async (key, field) => {    try {      var result = await collection.lookupIn(key, [        couchbase.LookupInSpec.get(field),      ])      var fieldValue = result.content[0].value
            console.log('LookupIn Result: ')      console.log(result)
            console.log(`Field Value: `)      console.log(fieldValue)    } catch (error) {      console.error(error)    }  }
        getSubDocument('airline_10', 'country')    .then(() => process.exit(0))}
      main()
       

      Output:

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            jared.casey Jared Casey
            abhishek.singh Abhishek Kumar Singh
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes

                PagerDuty