How to use lookupIn

In couchbase document , there is no document for lookupIn usage for node js does not contains DocumentFragment

Also example of is not javascript , it is PHP and python

How can I get content of DocumentFragment ?

According to I can use contentByIndex and content methods

Can I use contents property directly? ot it is for internal usage?

const [field1,field2] = result.contents;

Any idea???

Hey @socketman2016,

Unfortunately it is not possible to use the contents data directly. Lookup must be performed using the provided methods in order to correctly index into the results. What are you trying to achieve, perhaps there is an alternative solution we can work out?

Cheers, Brett

The newer ES6 syntax is easier to use

const [field1,field2] = result.contents;

Hi @socketman2016,
The recent move of the Documentation platform has left a number of what were once common files across the SDKs, which in the new format are rather unsatisfactory. Having a little time to repair this after getting the latest Couchbase release documented, the team are now working on these, including the Sub-Document operations.

If you want to keep an eye on progress, the relevant ticket is

Cheers, Richard
1 Like