Options
Analytics
Binary
AppendOptions
- classcouchbase.options.AppendOptions(timeout=None,durability=None,cas=None,span=None)
Available options to for a binary append operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
cas (int,optional) – If specified, indicates that operation should be failed if the CAS has changed fromthis value, indicating that the document has changed.
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.
DecrementOptions
- classcouchbase.options.DecrementOptions(timeout=None,expiry=None,durability=None,delta=None,initial=None,span=None)
Available options to for a decrement append operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.delta (
DeltaValue
, optional) – The amount to increment the key. Defaults to 1.initial (
SignedInt64
, optional) – The initial value to use for the document if it does not alreadyexist. Setting it to a negative value means that the document will not be created if it does not exist.Defaults to 0.
IncrementOptions
- classcouchbase.options.IncrementOptions(timeout=None,expiry=None,durability=None,delta=None,initial=None,span=None)
Available options to for a binary increment operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.delta (
DeltaValue
, optional) – The amount to increment the key. Defaults to 1.initial (
SignedInt64
, optional) – The initial value to use for the document if it does not alreadyexist. Setting it to a negative value means that the document will not be created if it does not exist.Defaults to 0.
PrependOptions
- classcouchbase.options.PrependOptions(timeout=None,durability=None,cas=None,span=None)
Available options to for a binary prepend operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
cas (int,optional) – If specified, indicates that operation should be failed if the CAS has changed fromthis value, indicating that the document has changed.
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.
Binary Multi
AppendMultiOptions
- classcouchbase.options.AppendMultiOptions(timeout=None,durability=None,cas=None,span=None,per_key_options=None,return_exceptions=None)
Available options to for a binary multi-append operation.
Options can be set at a global level (i.e. for all append operations handled with this multi-append operation).Useper_key_options to set specific
AppendOptions
for specific keys.- Parameters:
cas (int,optional) – If specified, indicates that operation should be failed if the CAS has changed fromthis value, indicating that the document has changed.
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.per_key_options (Dict[str,
AppendOptions
], optional) – SpecifyAppendOptions
per key.return_exceptions (bool,optional) – If False, raise an Exception when encountered. If True return theException without raising. Defaults to True.
DecrementMultiOptions
- classcouchbase.options.DecrementMultiOptions(timeout=None,durability=None,delta=None,initial=None,span=None,per_key_options=None,return_exceptions=None)
Available options to for a binary multi-decrement operation.
Options can be set at a global level (i.e. for all decrement operations handled with this multi-decrement operation).Useper_key_options to set specific
DecrementOptions
for specific keys.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.delta (
DeltaValue
, optional) – The amount to decrement the key. Defaults to 1.initial (
SignedInt64
, optional) – The initial value to use for the document if it does not alreadyexist. Defaults to 0.per_key_options (Dict[str,
DecrementOptions
], optional) – SpecifyDecrementOptions
perkey.return_exceptions (bool,optional) – If False, raise an Exception when encountered. If True return theException without raising. Defaults to True.
IncrementMultiOptions
- classcouchbase.options.IncrementMultiOptions(timeout=None,durability=None,delta=None,initial=None,span=None,per_key_options=None,return_exceptions=None)
Available options to for a binary multi-increment operation.
Options can be set at a global level (i.e. for all increment operations handled with this multi-increment operation).Useper_key_options to set specific
IncrementOptions
for specific keys.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.delta (
DeltaValue
, optional) – The amount to increment the key. Defaults to 1.initial (
SignedInt64
, optional) – The initial value to use for the document if it does not alreadyexist. Defaults to 0.per_key_options (Dict[str,
IncrementOptions
], optional) – SpecifyIncrementOptions
perkey.return_exceptions (bool,optional) – If False, raise an Exception when encountered. If True return theException without raising. Defaults to True.
PrependMultiOptions
- classcouchbase.options.PrependMultiOptions(timeout=None,durability=None,cas=None,span=None,per_key_options=None,return_exceptions=None)
Available options to for a binary multi-prepend operation.
Options can be set at a global level (i.e. for all prepend operations handled with this multi-prepend operation).Useper_key_options to set specific
PrependOptions
for specific keys.- Parameters:
cas (int,optional) – If specified, indicates that operation should be failed if the CAS has changed fromthis value, indicating that the document has changed.
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.per_key_options (Dict[str,
PrependOptions
], optional) – SpecifyPrependOptions
per key.return_exceptions (bool,optional) – If False, raise an Exception when encountered. If True return theException without raising. Defaults to True.
Cluster
ClusterOptions
- classcouchbase.options.ClusterOptions(authenticator,timeout_options=None,tracing_options=None,enable_tls=None,enable_mutation_tokens=None,enable_tcp_keep_alive=None,ip_protocol=None,enable_dns_srv=None,show_queries=None,enable_unordered_execution=None,enable_clustermap_notification=None,enable_compression=None,enable_tracing=None,enable_metrics=None,network=None,tls_verify=None,serializer=None,transcoder=None,tcp_keep_alive_interval=None,config_poll_interval=None,config_poll_floor=None,max_http_connections=None,user_agent_extra=None,logging_meter_emit_interval=None,transaction_config=None,log_redaction=None,compression=None,compression_min_size=None,compression_min_ratio=None,lockmode=None,tracer=None,meter=None,dns_nameserver=None,dns_port=None,disable_mozilla_ca_certificates=None,dump_configuration=None,preferred_server_group=None,enable_app_telemetry=None,app_telemetry_endpoint=None,app_telemetry_backoff=None,app_telemetry_ping_interval=None,app_telemetry_ping_timeout=None)
Available options to set when creating a cluster.
Warning
Importing options from
couchbase.cluster
is deprecated.All options should be imported fromcouchbase.options
.Cluster options enable the configuration of various global cluster settings.Some options can be set globally for the cluster, but overridden for specificoperations (i.e. ClusterTimeoutOptions)
Note
The authenticator is mandatory, all the other cluster options are optional.
- Parameters:
authenticator (Union[
PasswordAuthenticator
,CertificateAuthenticator
]) – Anauthenticator instancetimeout_options (
ClusterTimeoutOptions
) – Timeout options forvarious SDK operations. SeeClusterTimeoutOptions
for details.tracing_options (
ClusterTimeoutOptions
) – Tracing options for SDK tracing bevavior.SeeClusterTracingOptions
for details. These are ignored if an external traceris specified.enable_tls (bool,optional) – Set to True to enable tls. Defaults to False (disabled).
enable_mutation_tokens (bool,optional) – Set to False to disable mutation tokens in mutation results.Defaults to True (enabled).
enable_tcp_keep_alive (bool,optional) – Set to False to disable tcp keep alive. Defaults to True (enabled).
ip_protocol (Union[str,
IpProtocol
) – Set IP protocol. Defaults to IpProtocol.Any.enable_dns_srv (bool,optional) – Set to False to disable DNS SRV. Defaults to True (enabled).
show_queries (bool,optional) – Set to True to enabled showing queries. Defaults to False (disabled).
enable_unordered_execution (bool,optional) – Set to False to disable unordered query execution.Defaults to True (enabled).
enable_clustermap_notification (bool,optional) – Set to False to disable cluster map notification.Defaults to True (enabled).
enable_compression (bool,optional) – Set to False to disable compression. Defaults to True (enabled).
enable_tracing (bool,optional) – Set to False to disable tracing (enables no-op tracer).Defaults to True (enabled).
enable_metrics (bool,optional) – Set to False to disable metrics (enables no-op meter).Defaults to True (enabled).
network (str,optional) – Set network resolution method. Can be set to ‘default’ (if the client is running on thesame network as the server) or ‘external’ (if the client is running on a different network). Defaults to‘auto’.
tls_verify (Union[str,
TLSVerifyMode
], optional) – Set tls verify mode. Defaults toTLSVerifyMode.PEER.disable_mozilla_ca_certificates (bool,optional) – Set to True to disable loading Mozilla’s list of CAcertificates for TLS verification. Defaults to False (enabled).
serializer (
Serializer
, optional) – Global serializer to translate JSON to Python objects.Defaults toDefaultJsonSerializer
.transcoder (
Transcoder
, optional) – Global transcoder to use for kv-operations.Defaults toJsonTranscoder
.tcp_keep_alive_interval (timedelta,optional) – TCP keep-alive interval. Defaults to None.
config_poll_interval (timedelta,optional) – Config polling floor interval.Defaults to None.
config_poll_floor (timedelta,optional) – Config polling floor interval.Defaults to None.
max_http_connections (int,optional) – Maximum number of HTTP connections. Defaults to None.
logging_meter_emit_interval (timedelta,optional) – Logging meter emit interval. Defaults to 10 minutes.
transaction_config (
TransactionConfig
, optional) – Global configuration for transactions.Defaults to None.log_redaction (bool,optional) – Set to True to enable log redaction. Defaults to False (disabled).
compression (
Compression
, optional) – Set compression mode. Defaults to None.compression_min_size (int,optional) – Set compression min size. Defaults to None.
compression_min_ratio (float,optional) – Set compression min size. Defaults to None.
lockmode (
LockMode
, optional) –DEPRECATED This option will be removed in a future version of the SDK.Set LockMode mode. Defaults to None.tracer (
CouchbaseTracer
, optional) – Set an external tracer. Defaults to None,enabling thethreshold_logging_tracer. Note when this is set, all tracing_options(seeClusterTracingOptions
) and thenenable_tracing option are ignored.meter (
CouchbaseMeter
, optional) – Set an external meter. Defaults to None,enabling thelogging_meter. Note when this is set, thelogging_meter_emit_interval option is ignored.dns_nameserver (str,optional) –VOLATILE This API is subject to change at any time. Set to configure custom DNS nameserver. Defaults to None.
dns_port (int,optional) –VOLATILE This API is subject to change at any time. Set to configure custom DNS port. Defaults to None.
dump_configuration (bool,optional) – Set to True to dump every new configuration when TRACE level logging. Defaults to False (disabled).
preferred_server_group (str,optional) – Specifies the preferred server group to be used for replica reads with ‘selected server group’ read preference.
enable_app_telemetry (bool,optional) – Specifies if application telemetry feature should be enabled. Defaults to True (enabled).
app_telemetry_endpoint (str,optional) – Specifies an endpoint to override the application metrics endpoint discovered during configuration. Defaults to None.
app_telemetry_backoff (timedelta,optional) – Specifies the time to wait before attempting a websocket reconnection. Defaults to 5 seconds.
app_telemetry_ping_interval (timedelta,optional) – Specifies the time to wait between sending consecutive websocket PING commands to the server. Defaults to 30 seconds.
app_telemetry_ping_timeout (timedelta,optional) – Specifies the time allowed for the server to respond to websocket PING command. Defaults to 2 seconds.
ClusterTimeoutOptions
- classcouchbase.options.ClusterTimeoutOptions(bootstrap_timeout=None,resolve_timeout=None,connect_timeout=None,kv_timeout=None,kv_durable_timeout=None,views_timeout=None,query_timeout=None,analytics_timeout=None,search_timeout=None,management_timeout=None,dns_srv_timeout=None,idle_http_connection_timeout=None,config_idle_redial_timeout=None,config_total_timeout=None)
Available timeout options to set when creating a cluster.
Warning
Importing options from
couchbase.cluster
is deprecated.All options should be imported fromcouchbase.options
.These will set the default timeouts for operations for the cluster. Some operations allow the timeout tobe overridden on a per operation basis.
- Parameters:
bootstrap_timeout (timedelta,optional) – Overall bootstrap timeout. Defaults to None.
resolve_timeout (timedelta,optional) – Time to resolve hostnames. Defaults to None.
connect_timeout (timedelta,optional) – connect timeout. Defaults to None.
kv_timeout (timedelta,optional) – KV operations timeout. Defaults to None.
kv_durable_timeout (timedelta,optional) – KV durability operations timeout. Defaults to None.
views_timeout (timedelta,optional) – views operations timeout. Defaults to None.
query_timeout (timedelta,optional) – query operations timeout. Defaults to None.
analytics_timeout (timedelta,optional) – analytics operations timeout. Defaults to None.
search_timeout (timedelta,optional) – search operations timeout. Defaults to None.
management_timeout (timedelta,optional) – management operations timeout. Defaults to None.
dns_srv_timeout (timedelta,optional) – Time to make DNS-SRV query. Defaults to None.
idle_http_connection_timeout (timedelta,optional) – Idle HTTP connection timeout. Defaults to None.
config_idle_redial_timeout (timedelta,optional) – Idle redial timeout. Defaults to None.
config_total_timeout (timedelta,optional) –DEPRECATED complete bootstrap timeout. Defaults to None.
ClusterTracingOptions
- classcouchbase.options.ClusterTracingOptions(tracing_threshold_kv=None,tracing_threshold_view=None,tracing_threshold_query=None,tracing_threshold_search=None,tracing_threshold_analytics=None,tracing_threshold_eventing=None,tracing_threshold_management=None,tracing_threshold_queue_size=None,tracing_threshold_queue_flush_interval=None,tracing_orphaned_queue_size=None,tracing_orphaned_queue_flush_interval=None)
Available tracing options to set when creating a cluster.
Warning
Importing options from
couchbase.cluster
is deprecated.All options should be imported fromcouchbase.options
.These will be the default timeouts for operations for the entire cluster
- Parameters:
tracing_threshold_kv (timedelta,optional) – KV operations threshold. Defaults to None.
tracing_threshold_view (timedelta,optional) – Views operations threshold. Defaults to None.
tracing_threshold_query (timedelta,optional) – Query operations threshold. Defaults to None.
tracing_threshold_search (timedelta,optional) – Search operations threshold.. Defaults to None.
tracing_threshold_analytics (timedelta,optional) – Analytics operations threshold. Defaults to None.
tracing_threshold_eventing (timedelta,optional) – Eventing operations threshold. Defaults to None.
tracing_threshold_management (timedelta,optional) – Management operations threshold. Defaults to None.
tracing_threshold_queue_size (int,optional) – Size of tracing operations queue. Defaults to None.
tracing_threshold_queue_flush_interval (timedelta,optional) – Interveral to flush tracing operations queue.Defaults to None.
tracing_orphaned_queue_size (int,optional) – Size of tracing orphaned operations queue. Defaults to None.
tracing_orphaned_queue_flush_interval (timedelta,optional) – Interveral to flush tracing orphaned operationsqueue. Defaults to None.
Diagnostics
DiagnosticsOptions
- classcouchbase.options.DiagnosticsOptions(report_id=None)
Available options to for a diagnostics operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
report_id (str,optional) – A unique identifier for the report generated by this operation.
PingOptions
- classcouchbase.options.PingOptions(timeout=None,report_id=None,service_types=None)
Available options to for a ping operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
report_id (str,optional) – A unique identifier for the report generated by this operation.
(Iterable[class (service_types) –~couchbase.diagnostics.ServiceType]): The services which should be pinged.
WaitUntilReadyOptions
- classcouchbase.options.WaitUntilReadyOptions(desired_state=None,service_types=None)
Available options to for a wait until ready operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
desired_state (
ClusterState
, optional) – The desired state to wait for inorder to determine the cluster or bucket is ready. Defaults toOnline.(Iterable[class (service_types) –~couchbase.diagnostics.ServiceType]): The services which should be pinged.
Key-Value
ExistsOptions
- classcouchbase.options.ExistsOptions(timeout=None)
Available options to for a key-value exists operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
GetOptions
- classcouchbase.options.GetOptions(timeout=None,with_expiry=None,project=None,transcoder=None)
Available options to for a key-value get operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
with_expiry (bool,optional) – Indicates that the expiry of the document should befetched alongside the data itself. Defaults to False.
project (Iterable[str],optional) – Specifies a list of fields within the document which should be fetched.This allows for easy retrieval of select fields without incurring the overhead of fetching thewhole document.
transcoder (
Transcoder
, optional) – Specifies an explicit transcoderto use for this specific operation. Defaults toJsonTranscoder
.
GetAndLockOptions
- classcouchbase.options.GetAndLockOptions(timeout=None,transcoder=None)
Available options to for a key-value get and lock operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
transcoder (
Transcoder
, optional) – Specifies an explicit transcoderto use for this specific operation. Defaults toJsonTranscoder
.
GetAndTouchOptions
- classcouchbase.options.GetAndTouchOptions(timeout=None,transcoder=None)
Available options to for a key-value get and touch operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
transcoder (
Transcoder
, optional) – Specifies an explicit transcoderto use for this specific operation. Defaults toJsonTranscoder
.
InsertOptions
- classcouchbase.options.InsertOptions(timeout=None,expiry=None,durability=None,transcoder=None)
Available options to for a key-value insert operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
expiry (timedelta,optional) – Specifies the expiry time for this document.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.transcoder (
Transcoder
, optional) – Specifies an explicit transcoderto use for this specific operation. Defaults toJsonTranscoder
.
RemoveOptions
- classcouchbase.options.RemoveOptions(timeout=None,cas=None,durability=None)
Available options to for a key-value remove operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
cas (int,optional) – If specified, indicates that operation should be failed if the CAS has changed fromthis value, indicating that the document has changed.
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.
ReplaceOptions
- classcouchbase.options.ReplaceOptions(timeout=None,expiry=None,cas=None,preserve_expiry=False,durability=None,transcoder=None)
Available options to for a key-value replace operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
cas (int,optional) – If specified, indicates that operation should be failed if the CAS has changed fromthis value, indicating that the document has changed.
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
expiry (timedelta,optional) – Specifies the expiry time for this document.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.preserve_expiry (bool,optional) – Specifies that any existing expiry on the document should be preserved.
transcoder (
Transcoder
, optional) – Specifies an explicit transcoderto use for this specific operation. Defaults toJsonTranscoder
.
TouchOptions
- classcouchbase.options.TouchOptions(timeout=None)
Available options to for a key-value exists operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
UnlockOptions
- classcouchbase.options.UnlockOptions(timeout=None)
Available options to for a key-value exists operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
UpsertOptions
- classcouchbase.options.UpsertOptions(timeout=None,expiry=None,preserve_expiry=False,durability=None,transcoder=None)
Available options to for a key-value upsert operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
expiry (timedelta,optional) – Specifies the expiry time for this document.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.preserve_expiry (bool,optional) – Specifies that any existing expiry on the document should be preserved.
transcoder (
Transcoder
, optional) – Specifies an explicit transcoderto use for this specific operation. Defaults toJsonTranscoder
.
ScanOptions
- classcouchbase.options.ScanOptions(timeout=None,ids_only=None,consistent_with=None,batch_byte_limit=None,batch_item_limit=None,batch_time_limit=None,transcoder=None,concurrency=None,span=None)
Available options to for a key-value scan operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalrange scan operation timeout.
ids_only (bool,optional) – Specifies that scan should only return document ids. Defaults to False.
consistent_with (
MutationState
, optional) – Specifies aMutationState
which the scan should be consistent with. Defaults to None.batch_byte_limit (int,optional) – The limit applied to the number of bytes returned from the serverfor each partition batch. Defaults to 15k.
batch_item_limit (int,optional) – The limit applied to the number of items returned from the serverfor each partition batch. Defaults to 50.
transcoder (
Transcoder
, optional) – Specifies an explicit transcoderto use for this specific operation. Defaults toJsonTranscoder
.concurrency (int,optional) – The upper bound on the number of vbuckets that should be scanned in parallel.Defaults to 1.
Key-Value Multi
ExistsMultiOptions
- classcouchbase.options.ExistsMultiOptions(timeout=None,per_key_options=None,return_exceptions=None)
Available options to for a key-value multi-exists operation.
Options can be set at a global level (i.e. for all exists operations handled with this multi-exists operation).Useper_key_options to set specific
ExistsOptions
for specific keys.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
per_key_options (Dict[str,
ExistsOptions
], optional) – SpecifyExistsOptions
per key.return_exceptions (bool,optional) – If False, raise an Exception when encountered. If True return theException without raising. Defaults to True.
GetMultiOptions
- classcouchbase.options.GetMultiOptions(timeout=None,with_expiry=None,project=None,transcoder=None,per_key_options=None,return_exceptions=None)
Available options to for a key-value multi-get operation.
Options can be set at a global level (i.e. for all get operations handled with this multi-get operation).Useper_key_options to set specific
GetOptions
for specific keys.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
with_expiry (bool,optional) – Indicates that the expiry of the document should befetched alongside the data itself. Defaults to False.
project (Iterable[str],optional) – Specifies a list of fields within the document which should be fetched.This allows for easy retrieval of select fields without incurring the overhead of fetching thewhole document.
transcoder (
Transcoder
, optional) – Specifies an explicit transcoderto use for this specific operation. Defaults toJsonTranscoder
.per_key_options (Dict[str,
GetOptions
], optional) – SpecifyGetOptions
per key.return_exceptions (bool,optional) – If False, raise an Exception when encountered. If True return theException without raising. Defaults to True.
InsertMultiOptions
- classcouchbase.options.InsertMultiOptions(timeout=None,expiry=None,durability=None,transcoder=None,per_key_options=None,return_exceptions=None)
Available options to for a key-value multi-insert operation.
Options can be set at a global level (i.e. for all insert operations handled with this multi-insert operation).Useper_key_options to set specific
InsertOptions
for specific keys.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
expiry (timedelta,optional) – Specifies the expiry time for this document.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.transcoder (
Transcoder
, optional) – Specifies an explicit transcoderto use for this specific operation. Defaults toJsonTranscoder
.per_key_options (Dict[str,
InsertOptions
], optional) – SpecifyInsertOptions
per key.return_exceptions (bool,optional) – If False, raise an Exception when encountered. If True return theException without raising. Defaults to True.
LockMultiOptions
- couchbase.options.LockMultiOptions
alias of
GetAndLockMultiOptions
ReplaceMultiOptions
- classcouchbase.options.ReplaceMultiOptions(timeout=None,expiry=None,cas=0,preserve_expiry=False,durability=None,transcoder=None,per_key_options=None,return_exceptions=None)
Available options to for a key-value multi-replace operation.
Options can be set at a global level (i.e. for all replace operations handled with this multi-replace operation).Useper_key_options to set specific
ReplaceOptions
for specific keys.- Parameters:
cas (int,optional) – If specified, indicates that operation should be failed if the CAS has changed fromthis value, indicating that the document has changed.
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
expiry (timedelta,optional) – Specifies the expiry time for this document.
preserve_expiry (bool,optional) – Specifies that any existing expiry on the document should be preserved.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.transcoder (
Transcoder
, optional) – Specifies an explicit transcoderto use for this specific operation. Defaults toJsonTranscoder
.per_key_options (Dict[str,
ReplaceOptions
], optional) – SpecifyReplaceOptions
per key.return_exceptions (bool,optional) – If False, raise an Exception when encountered. If True return theException without raising. Defaults to True.
RemoveMultiOptions
- classcouchbase.options.RemoveMultiOptions(timeout=None,cas=0,durability=None,transcoder=None,per_key_options=None,return_exceptions=None)
Available options to for a key-value multi-remove operation.
Options can be set at a global level (i.e. for all remove operations handled with this multi-remove operation).Useper_key_options to set specific
RemoveOptions
for specific keys.- Parameters:
cas (int,optional) – If specified, indicates that operation should be failed if the CAS has changed fromthis value, indicating that the document has changed.
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.transcoder (
Transcoder
, optional) – Specifies an explicit transcoderto use for this specific operation. Defaults toJsonTranscoder
.per_key_options (Dict[str,
RemoveOptions
], optional) – SpecifyRemoveOptions
per key.return_exceptions (bool,optional) – If False, raise an Exception when encountered. If True return theException without raising. Defaults to True.
TouchMultiOptions
- classcouchbase.options.TouchMultiOptions(timeout=None,per_key_options=None,return_exceptions=None)
Available options to for a key-value multi-touch operation.
Options can be set at a global level (i.e. for all touch operations handled with this multi-touch operation).Useper_key_options to set specific
TouchOptions
for specific keys.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
per_key_options (Dict[str,
TouchOptions
], optional) – SpecifyTouchOptions
per key.return_exceptions (bool,optional) – If False, raise an Exception when encountered. If True return theException without raising. Defaults to True.
UnlockMultiOptions
- classcouchbase.options.UnlockMultiOptions(timeout=None,per_key_options=None,return_exceptions=None)
Available options to for a key-value multi-unlock operation.
Options can be set at a global level (i.e. for all unlock operations handled with this multi-unlock operation).Useper_key_options to set specific
UnlockOptions
for specific keys.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
per_key_options (Dict[str,
UnlockOptions
], optional) – SpecifyUnlockOptions
perkey.return_exceptions (bool,optional) – If False, raise an Exception when encountered. If True return theException without raising. Defaults to True.
UpsertMultiOptions
- classcouchbase.options.UpsertMultiOptions(timeout=None,expiry=None,preserve_expiry=False,durability=None,transcoder=None,per_key_options=None,return_exceptions=None)
Available options to for a key-value multi-upsert operation.
Options can be set at a global level (i.e. for all upsert operations handled with this multi-upsert operation).Useper_key_options to set specific
UpsertOptions
for specific keys.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalkey-value operation timeout.
expiry (timedelta,optional) – Specifies the expiry time for this document.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.preserve_expiry (bool,optional) – Specifies that any existing expiry on the document should be preserved.
transcoder (
Transcoder
, optional) – Specifies an explicit transcoderto use for this specific operation. Defaults toJsonTranscoder
.per_key_options (Dict[str,
UpsertOptions
], optional) – SpecifyUpsertOptions
per key.return_exceptions (bool,optional) – If False, raise an Exception when encountered. If True return theException without raising. Defaults to True.
Query
QueryOptions
- classcouchbase.options.QueryOptions(timeout=None,read_only=None,scan_consistency=None,adhoc=None,client_context_id=None,max_parallelism=None,positional_parameters=None,named_parameters=None,pipeline_batch=None,pipeline_cap=None,profile=None,query_context=None,scan_cap=None,scan_wait=None,metrics=None,flex_index=None,preserve_expiry=None,use_replica=None,consistent_with=None,send_to_node=None,raw=None,span=None,serializer=None)
Available options to for a N1QL (SQL++) query.
Warning
Importing options from
couchbase.cluster
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalquery operation timeout.
read_only (bool,optional) – Specifies that this query should be executed in read-only mode,disabling the ability for the query to make any changes to the data. Defaults to False.
scan_consistency (
QueryScanConsistency
, optional) – Specifies the consistencyrequirements when executing the query.adhoc (bool,optional) – Specifies whether this is an ad-hoc query, or if it should be prepared forfaster execution in the future. Defaults to True.
client_context_id (str,optional) – The returned client context id for this query. Defaults to None.
max_parallelism (int,optional) – This is an advanced option, see the query service reference for moreinformation on the proper use and tuning of this option. Defaults to None.
positional_parameters (Iterable[JSONType],optional) – Positional values to be used for the placeholderswithin the query. Defaults to None.
named_parameters (Iterable[Dict[str,JSONType]],optional) – Named values to be used for the placeholderswithin the query. Defaults to None.
pipeline_batch (int,optional) – This is an advanced option, see the query service reference for moreinformation on the proper use and tuning of this option. Defaults to None.
pipeline_cap (int,optional) – This is an advanced option, see the query service reference for moreinformation on the proper use and tuning of this option. Defaults to None.
profile (
QueryProfile
, optional) – Specifies the level of profiling that shouldbe used for the query. Defaults toOff.query_context (str,optional) – Specifies the context within which this query should be executed. This canbe scoped to a scope or a collection within the dataset. Defaults to None.
scan_cap (int,optional) – This is an advanced option, see the query service reference for moreinformation on the proper use and tuning of this option. Defaults to None.
scan_wait (timedelta,optional) – This is an advanced option, see the query service reference for moreinformation on the proper use and tuning of this option. Defaults to None.
metrics (bool,optional) – Specifies whether metrics should be captured as part of the execution of the query.Defaults to False.
flex_index (bool,optional) – Specifies whether flex-indexes should be enabled. Allowing the use of full-textsearch from the query service. Defaults to False.
preserve_expiry (bool,optional) – Specifies that any existing expiry on the document should be preserved.Defaults to False.
use_replica (bool,optional) – Specifies that the query engine should use replica nodes for KV fetches if theactive node is down. Defaults to None.
consistent_with (
MutationState
, optional) – Specifies aMutationState
which the query should be consistent with. Defaults toNone.serializer (
Serializer
, optional) – Specifies an explicit serializerto use for this specific N1QL operation. Defaults toDefaultJsonSerializer
.raw (Dict[str,Any],optional) – Specifies any additional parameters which should be passed to the query enginewhen executing the query. Defaults to None.
Search
SearchOptions
- classcouchbase.options.SearchOptions(timeout=None,limit=None,skip=None,explain=None,fields=None,highlight_style=None,highlight_fields=None,scan_consistency=None,consistent_with=None,facets=None,raw=None,sort=None,disable_scoring=None,scope_name=None,collections=None,include_locations=None,client_context_id=None,serializer=None,show_request=None,log_request=None,log_response=None)
Available options to for a search (FTS) query.
Warning
Importing options from
couchbase.search
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalsearch query operation timeout.
limit (int,optional) – Specifies the limit to the number of results that should be returned.Defaults to None.
skip (int,optional) – Specifies the number of results to skip from the index before returningresults. Defaults to None.
explain (bool,optional) – Configures whether the result should contain the execution plan for thesearch query. Defaults to False.
fields (List[str],optional) – Specifies the list of fields which should be searched. Defaults to None.
highlight_style (
HighlightStyle
, optional) – Specifies the mode used forhighlighting. Defaults to None.highlight_fields (List[str],optional) – Specifies the list of fields that should be highlighted.Defaults to None.
scan_consistency (
SearchScanConsistency
, optional) – Specifies the consistencyrequirements when executing the search query.facets (Dict[str,
Facet
], optional) – Specifies any facets that should be includedin the search query. Defaults to None.client_context_id (str,optional) – The returned client context id for this query. Defaults to None.
disable_scoring (bool,optional) – Specifies that scoring should be disabled. This improves performance butmakes it impossible to sort based on how well a particular result scored. Defaults to False.
include_locations (bool optional) – If set to True, will include the locations in the search result.Defaults to False.
sort (Union[List[str],List[
Sort
]], optional) – Specifies a list of fields or searchSort
’s to use when sorting the result sets. Defaults to None.scope_name (string,optional) – Specifies the scope which should be searched as part of the searchquery. Defaults to None.
collections (List[str],optional) – Specifies the collections which should be searched as part of the searchquery. Defaults to None.
consistent_with (
MutationState
, optional) – Specifies aMutationState
which the search query should be consistent with.Defaults to None.serializer (
Serializer
, optional) – Specifies an explicit serializerto use for this specific search query. Defaults toDefaultJsonSerializer
.raw (Dict[str,Any],optional) – Specifies any additional parameters which should be passed to the search queryengine when executing the search query. Defaults to None.
show_request (bool,optional) – Specifies if the search response should contain the request for the search query. Defaults to False.
log_request (bool,optional) –UNCOMMITTED Specifies if search request body should appear the log. Defaults to False.
log_response (bool,optional) –UNCOMMITTED Specifies if search response should appear in the log. Defaults to False.
Subdocument
LookupInOptions
- classcouchbase.options.LookupInOptions(timeout=None,access_deleted=None)
Available options to for a subdocument lookup-in operation.
Warning
Importing options from
couchbase.collection
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalsubdocument operation timeout.
MutateInOptions
- classcouchbase.options.MutateInOptions(timeout=None,cas=0,durability=None,store_semantics=None,access_deleted=None,preserve_expiry=None)
Available options to for a subdocument mutate-in operation.
Warning
Importing options from
couchbase.subdocument
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
cas (int,optional) – If specified, indicates that operation should be failed if the CAS has changed fromthis value, indicating that the document has changed.
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalsubdocument operation timeout.
durability (
DurabilityType
, optional) – Specifies the level of durabilityfor this operation.preserve_expiry (bool,optional) – Specifies that any existing expiry on the document should be preserved.
store_semantics (
StoreSemantics
, optional) – Specifies the store semanticsto use for this operation.
Views
ViewOptions
- classcouchbase.options.ViewOptions(timeout=None,scan_consistency=None,skip=None,limit=None,startkey=None,endkey=None,startkey_docid=None,endkey_docid=None,inclusive_end=None,group=None,group_level=None,key=None,keys=None,order=None,reduce=None,on_error=None,debug=None,namespace=None,query_string=None,client_context_id=None,raw=None,full_set=None)
Available options to for a view query.
Warning
Importing options from
couchbase.bucket
is deprecated.All options should be imported fromcouchbase.options
.- Parameters:
timeout (timedelta,optional) – The timeout for this operation. Defaults to globalview query operation timeout.
scan_consistency (
ViewScanConsistency
, optional) – Specifies the consistencyrequirements when executing the view query. Defaults to None.limit (int,optional) – Specifies the limit to the number of results that should be returned.Defaults to None.
skip (int,optional) – Specifies the number of results to skip from the index before returningresults. Defaults to None.
startkey (JSONType,optional) – Specifies the first key that should be included in the results.Defaults to None.
endkey (JSONType,optional) – Specifies the last key that should be included in the results.Defaults to None.
startkey_docid (str,optional) – Specifies the first document ID that should be included in the results.Defaults to None.
endkey_docid (str,optional) – Specifies the last document ID that should be included in the results.Defaults to None.
inclusive_end (bool,optional) – Specifies whether the end key should be considered inclusive or exclusive.Defaults to None.
group (bool,optional) – Specifies whether the results should be grouped together. Defaults to None.
group_level (int,optional) – Specifies the level to which results should be group. Defaults to None.
key (JSONType,optional) – Specifies a specific key which should be fetched from the index. Defaults to None.
keys (List[JSONType],optional) – Specifies a list of keys which should be fetched from the index.Defaults to None.
order (
ViewOrdering
, optional) – Specifies the ordering that should be used whenreturning results. Defaults to None.reduce (bool,optional) – Specifies whether reduction should be performed as part of the view query.Defaults to None.
on_error (
ViewErrorMode
, optional) – Specifies the error-handling behaviourthat should be used when an error occurs. Defaults to None.namespace (
DesignDocumentNamespace
, optional) – Specifies the namespacefor the design document. Defaults toDevelopment
.client_context_id (str,optional) – The returned client context id for this view query. Defaults to None.
raw (Dict[str,str],optional) – Specifies any additional parameters which should be passed to the view enginewhen executing the view query. Defaults to None.
full_set (bool,optional) – Specifies whether the query should force the entire set of document in the indexto be included in the result. Defaults to None.