class LookupInBuilder (View source)

A builder for subdocument lookups. In order to perform the final set of operations, use the execute() method.

Instances of this builder should be obtained through \Couchbase\Bucket->lookupIn()

Methods

get(string $path, array $options = [])

Get a value inside the JSON document.

getCount(string $path, array $options = [])

Get a count of values inside the JSON document.

exists(string $path, array $options = [])

Check if a value exists inside the document.

execute()

Perform several lookup operations inside a single existing JSON document, using a specific timeout

Details

LookupInBuilder get(string $path, array $options = [])

Get a value inside the JSON document.

Parameters

string $path

the path inside the document where to get the value from.

array $options

the array with command modificators. Supported values are

  • "xattr" (default: false) if true, the path refers to a location within the document's extended attributes, not the document body.

Return Value

LookupInBuilder

LookupInBuilder getCount(string $path, array $options = [])

Get a count of values inside the JSON document.

This method is only available with Couchbase Server 5.0 and later.

Parameters

string $path

the path inside the document where to get the count from.

array $options

the array with command modificators. Supported values are

  • "xattr" (default: false) if true, the path refers to a location within the document's extended attributes, not the document body.

Return Value

LookupInBuilder

LookupInBuilder exists(string $path, array $options = [])

Check if a value exists inside the document.

This doesn't transmit the value on the wire if it exists, saving the corresponding byte overhead.

Parameters

string $path

the path inside the document to check for existence

array $options

the array with command modificators. Supported values are

  • "xattr" (default: false) if true, the path refers to a location within the document's extended attributes, not the document body.

Return Value

LookupInBuilder

DocumentFragment execute()

Perform several lookup operations inside a single existing JSON document, using a specific timeout

Return Value

DocumentFragment