{ "ns" : "http://www.zorba-xquery.com/modules/couchbase", "description" : " : This module provides minimal functionality to interact with the : Couchbase NoSQL database. : : The module is built using the libcouchbase C client library and : exposes most of its functionality in XQuery with JSONiq extensions. : Beyond just allowing for basic key-value store operations (e.g. : put-/get-text or put-/get-binary, this module also allows to work : with Couchbase views in order to allow for complex JSON query : operations. : : @author Juan Zacarias : @project DB Drivers/Couchbase :\n", "sees" : [ ], "authors" : [ ], "version" : null, "encoding" : "utf-8", "namespaces" : [ { "uri" : "http://zorba.io/annotations", "prefix" : "an" }, { "uri" : "http://www.zorba-xquery.com/modules/couchbase", "prefix" : "cb" }, { "uri" : "http://jsoniq.org/functions", "prefix" : "jn" }, { "uri" : "http://zorba.io/options/versioning", "prefix" : "ver" } ], "functions" : [ { "arity" : 1, "name" : "connect", "qname" : "cb:connect", "signature" : "($options as object()) as xs:anyURI external", "description" : " : Connect to the Couchbase server and return an opaque identifier : representing the established connection. : : @param $options a JSONiq object that contains the host, bucket, : and user information. : : @option \"host\" endpoint of the Couchbase server (mandatory) : @option \"username\" username used for the connection (optional) : @option \"password\" password used for the connection (optional) : @option \"bucket\" name of an existing bucket (mandatory) : : @error cb:LCB0001 if the connection to the given host/bucket : could not be established. : @error cb:CB0001 if mandatory connection information is missing. : @error cb:CB0007 if a given option is not supported. : : @return an identifier for the established connection. : : Example: : : { : \"host\": \"localhost:8091\", : \"username\" : null, : \"password\" : null, : \"bucket\" : \"default\" : } :
\n ", "summary" : "
: Connect to the Couchbase server and return an opaque identifier : representing the established connection.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "options", "type" : "object()", "occurence" : null, "description" : "" } ], "returns" : { "type" : "xs:anyURI", "description" : "" }, "errors" : [ ] }, { "arity" : 4, "name" : "connect", "qname" : "cb:connect", "signature" : "($host as xs:string, $username as xs:string?, $password as xs:string?, $bucket as xs:string) as xs:anyURI", "description" : " : Connect to the Couchbase server and return an opaque identifier : representing the established connection. : : @param $host address of the couchbase server (e.g. \"localhost:8091\") : @param $username username used for the connection : @param $password password used for the connection : @param $bucket name of the bucket to use (e.g. \"default\") : : @error cb:LCB0001 if the connection to the given host/bucket : could not be established. : : @return an identifier for the established connection.\n", "summary" : ": Connect to the Couchbase server and return an opaque identifier : representing the established connection.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "host", "type" : "xs:string", "occurence" : null, "description" : "" }, { "name" : "username", "type" : "xs:string", "occurence" : null, "description" : "" }, { "name" : "password", "type" : "xs:string", "occurence" : null, "description" : "" }, { "name" : "bucket", "type" : "xs:string", "occurence" : null, "description" : "" } ], "returns" : { "type" : "xs:anyURI", "description" : "" }, "errors" : [ ] }, { "arity" : 3, "name" : "create-view", "qname" : "cb:create-view", "signature" : "($db as xs:anyURI, $doc-name as xs:string, $view-names as xs:string*) as xs:string* external", "description" : " : Create a document/view. : If the document already exists, it is replaced. A document can hold several : views that must be specified in the same call of cb:create-view. : : @param $db connection reference : @param $doc-name name of the document to create. : @param $view-names names of the views to create in the document. : : @error cb:LCB0002 if any error occurs in the communication with : the server. : : @return the names of the paths for the views that have been : created.\n", "summary" : ": Create a document/view.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "db", "type" : "xs:anyURI", "occurence" : null, "description" : "" }, { "name" : "doc-name", "type" : "xs:string", "occurence" : null, "description" : "" }, { "name" : "view-names", "type" : "xs:string", "occurence" : null, "description" : "" } ], "returns" : { "type" : "xs:string*", "description" : "" }, "errors" : [ ] }, { "arity" : 4, "name" : "create-view", "qname" : "cb:create-view", "signature" : "($db as xs:anyURI, $doc-name as xs:string, $view-names as xs:string*, $options as object()*) as xs:string* external", "description" : " : Create a document/view. : If the document already exists, it is replaced. A document can hold several : views that must be specified in the same call of cb:create-view. : : @param $db connection reference : @param $doc-name name of the document to create. : @param $view-names names of the views to create in the document. : @param $options options describing how to create the view. : : @option \"key\" value must be a string containing the name of the value : in the json object stored in couchbase that is wanted to be : displayed as the value of \"key\" in the resulting json. : @option \"values\" value must be a string or an array of strings containing : the name of the value in the json object stored in couchbase that : is wanted to be displayed as the value of \"value\" in the resulting : json. : @option \"function\" string with a javascript function describing the : map function of the view. cb:create-view won't throw an error : if the javascript function is not compilable or functional. If : this option is set the \"key\" and \"values\" options are ignored. : : @error cb:LCB0002 if any error occurs in the communication with : the server. : @error cb:CB0005 if the number of options doesn't match the number of : view-names. : @error cb:CB0007 if any of the options is not supported. : @error cb:CB0010 if any of the given options has an invalid type. : : @return the names of the paths for the views that have been : created.\n", "summary" : ": Create a document/view.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "db", "type" : "xs:anyURI", "occurence" : null, "description" : "" }, { "name" : "doc-name", "type" : "xs:string", "occurence" : null, "description" : "" }, { "name" : "view-names", "type" : "xs:string", "occurence" : null, "description" : "" }, { "name" : "options", "type" : "object()", "occurence" : null, "description" : "" } ], "returns" : { "type" : "xs:string*", "description" : "" }, "errors" : [ ] }, { "arity" : 2, "name" : "delete-view", "qname" : "cb:delete-view", "signature" : "($db as xs:anyURI, $doc as xs:string*) as xs:string* external", "description" : " : Delete a document/view. : If the document doesn't exists, function does nothing. All the views hold in the : Document are deleted, this function can't delete single views. : : @param $db connection reference : @param $doc-name name of the document to create. : : @error cb:LCB0002 if any error occurs in the communication with : the server. : : @return empty sequence.\n", "summary" : ": Delete a document/view.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "db", "type" : "xs:anyURI", "occurence" : null, "description" : "" }, { "name" : "doc", "type" : "xs:string", "occurence" : null, "description" : "" } ], "returns" : { "type" : "xs:string*", "description" : "" }, "errors" : [ ] }, { "arity" : 1, "name" : "flush", "qname" : "cb:flush", "signature" : "($db as xs:anyURI) as empty-sequence() external", "description" : " : Remove all key/value pairs from the cluster : : @param $db connection reference : : @error cb:LCB0002 if any error occurs in the communication with : the server. : : @return a empty sequence.\n", "summary" : ": Remove all key/value pairs from the cluster : : @param $db connection reference : : @error cb:LCB0002 if any error occurs in the communication with : the server.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "db", "type" : "xs:anyURI", "occurence" : null, "description" : "" } ], "returns" : { "type" : "empty-sequence()", "description" : "" }, "errors" : [ ] }, { "arity" : 2, "name" : "get-binary", "qname" : "cb:get-binary", "signature" : "($db as xs:anyURI, $key as xs:string*) as xs:base64Binary* external", "description" : " : Return the values of the given keys (type xs:string) as base64Binary. : : @param $db connection reference : @param $key the requested keys : : @error cb:LCB0002 if any error occurs in the communication with : the server. : : @return a sequence of xs:base64Binary items for the given keys.\n", "summary" : ": Return the values of the given keys (type xs:string) as base64Binary.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "db", "type" : "xs:anyURI", "occurence" : null, "description" : "" }, { "name" : "key", "type" : "xs:string", "occurence" : null, "description" : "" } ], "returns" : { "type" : "xs:base64Binary*", "description" : "" }, "errors" : [ ] }, { "arity" : 3, "name" : "get-binary", "qname" : "cb:get-binary", "signature" : "($db as xs:anyURI, $key as xs:string*, $options as object()) as xs:base64Binary* external", "description" : " : Return the values of the given keys (type xs:string) as base64Binary. : : @param $db connection reference : @param $key the requested keys : @param $options JSONiq object with additional options : : @option \"expiration-time\" xs:integer value for refreshing the expiration : time in seconds. : : @error cb:LCB0002 if any error occurs in the communication with : the server. : @error cb:CB0007 if any of the options is not supported. : @error cb:CB0009 if the given expiration time is not an xs:integer. : : @return a sequence of xs:base64Binary items for the given keys.\n", "summary" : ": Return the values of the given keys (type xs:string) as base64Binary.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "db", "type" : "xs:anyURI", "occurence" : null, "description" : "" }, { "name" : "key", "type" : "xs:string", "occurence" : null, "description" : "" }, { "name" : "options", "type" : "object()", "occurence" : null, "description" : "" } ], "returns" : { "type" : "xs:base64Binary*", "description" : "" }, "errors" : [ ] }, { "arity" : 2, "name" : "get-text", "qname" : "cb:get-text", "signature" : "($db as xs:anyURI, $key as xs:string*) as xs:string* external", "description" : " : Return the values of the given keys (type xs:string) as string. : : @param $db connection reference : @param $key the requested keys : : @error cb:LCB0002 if any error occurs in the communication with : the server. : : @return A sequence of string Items corresponding to the key\n", "summary" : ": Return the values of the given keys (type xs:string) as string.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "db", "type" : "xs:anyURI", "occurence" : null, "description" : "" }, { "name" : "key", "type" : "xs:string", "occurence" : null, "description" : "" } ], "returns" : { "type" : "xs:string*", "description" : "" }, "errors" : [ ] }, { "arity" : 3, "name" : "get-text", "qname" : "cb:get-text", "signature" : "($db as xs:anyURI, $key as xs:string*, $options as object()) as xs:string* external", "description" : " : Return the values of the given keys (type xs:string) as string. : : @param $db connection reference : @param $key the requested keys : @param $options JSONiq object with additional options : : @option \"expiration-time\" xs:integer value for refreshing the expiration : time in seconds. : @option \"encoding\" string with the name of the encoding of the returned : string (if not UTF-8). : : @error cb:LCB0002 if any error occurs in the communication with : the server. : @error cb:CB0006 if the given encoding is not supported. : @error cb:CB0007 if any of the options is not supported. : @error cb:CB0009 if the given expiration time is not an xs:integer. : : @return a sequence of strings for the given keys.\n", "summary" : ": Return the values of the given keys (type xs:string) as string.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "db", "type" : "xs:anyURI", "occurence" : null, "description" : "" }, { "name" : "key", "type" : "xs:string", "occurence" : null, "description" : "" }, { "name" : "options", "type" : "object()", "occurence" : null, "description" : "" } ], "returns" : { "type" : "xs:string*", "description" : "" }, "errors" : [ ] }, { "arity" : 3, "name" : "put-binary", "qname" : "cb:put-binary", "signature" : "($db as xs:anyURI, $key as xs:string*, $value as xs:base64Binary*) as empty-sequence()", "description" : " : Store the given key-value bindings. : : @param $db connection reference : @param $key the keys to store : @param $value the values (as xs:base64binary) to be stored. : : @error cb:LCB0002 if any error occurs in the communication with : the server. : @error cb:CB0005 if the number of keys doesn't match the number : of values. : : @return a empty sequence.\n", "summary" : ": Store the given key-value bindings.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "db", "type" : "xs:anyURI", "occurence" : null, "description" : "" }, { "name" : "key", "type" : "xs:string", "occurence" : null, "description" : "" }, { "name" : "value", "type" : "xs:base64Binary", "occurence" : null, "description" : "" } ], "returns" : { "type" : "empty-sequence()", "description" : "" }, "errors" : [ ] }, { "arity" : 4, "name" : "put-binary", "qname" : "cb:put-binary", "signature" : "($db as xs:anyURI, $key as xs:string*, $value as xs:base64Binary*, $options as object()) as empty-sequence() external", "description" : " : Store the given key-value bindings. : : @param $db connection reference : @param $key the keys to store : @param $value the values (as xs:base64binary) to be stored. : @param $options JSONiq object with additional options : @option \"expiration-time\" integer value that represent the : expiration time in seconds. : @option \"operation\" type of operation, possible values are : \"add\", \"replace\", \"set\", \"append\" and \"prepend\". : @option \"wait\" variable for setting if a wait for persistancy in : the storing key is needed, possible values are \"persist\" : and \"false\". : : @error cb:LCB0002 if any error occurs in the communication with : the server. : @error cb:CB0005 if the number of keys doesn't match the number : of values. : @error cb:CB0007 if any of the options is not supported. : @error cb:CB0009 if the given expiration time is not an xs:integer. : @error cb:CB0011 if the stored Variable was not stored : : @return a empty sequence.\n", "summary" : ": Store the given key-value bindings.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "db", "type" : "xs:anyURI", "occurence" : null, "description" : "" }, { "name" : "key", "type" : "xs:string", "occurence" : null, "description" : "" }, { "name" : "value", "type" : "xs:base64Binary", "occurence" : null, "description" : "" }, { "name" : "options", "type" : "object()", "occurence" : null, "description" : "" } ], "returns" : { "type" : "empty-sequence()", "description" : "" }, "errors" : [ ] }, { "arity" : 3, "name" : "put-text", "qname" : "cb:put-text", "signature" : "($db as xs:anyURI, $key as xs:string*, $value as xs:string*) as empty-sequence()", "description" : " : Store the given key-value bindings. : : The values are stored with the UTF-8 encoding and a default : expiration time of 60 seconds. : : @param $db connection reference : @param $key the keys to store : @param $value the values (as xs:string) to be stored. : : @error cb:LCB0002 if any error occurs in the communication with : the server. : @error cb:CB0005 if the number of keys doesn't match the number : of values. : @return a empty sequence.\n", "summary" : ": Store the given key-value bindings.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "db", "type" : "xs:anyURI", "occurence" : null, "description" : "" }, { "name" : "key", "type" : "xs:string", "occurence" : null, "description" : "" }, { "name" : "value", "type" : "xs:string", "occurence" : null, "description" : "" } ], "returns" : { "type" : "empty-sequence()", "description" : "" }, "errors" : [ ] }, { "arity" : 4, "name" : "put-text", "qname" : "cb:put-text", "signature" : "($db as xs:anyURI, $key as xs:string*, $value as xs:string*, $options as object()) as empty-sequence() external", "description" : " : Store the given key-value bindings. : : @param $db connection reference : @param $key the keys to store : @param $value the values (as xs:string) to be stored. : @param $options JSONiq object with additional options : : @option \"expiration-time\" integer value that represent the : expiration time in seconds. : @option \"operation\" type of operation, possible values are : \"add\", \"replace\", \"set\", \"append\" and \"prepend\". : @option \"encoding\" the encoding that should be used for the : value (default is UTF-8). : @option \"wait\" variable for setting if a wait for persistancy in : the storing key is needed, possible values are \"persist\" : and \"false\". : : @error cb:LCB0002 if any error occurs in the communication with : the server. : @error cb:CB0005 if the number of keys doesn't match the number : of values. : @error cb:CB0006 if the given encoding is not supported. : @error cb:CB0007 if any of the options is not supported. : @error cb:CB0009 if the given expiration time is not an xs:integer. : @error cb:CB0011 if the stored Variable was not stored : : @return a empty sequence.\n", "summary" : ": Store the given key-value bindings.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "db", "type" : "xs:anyURI", "occurence" : null, "description" : "" }, { "name" : "key", "type" : "xs:string", "occurence" : null, "description" : "" }, { "name" : "value", "type" : "xs:string", "occurence" : null, "description" : "" }, { "name" : "options", "type" : "object()", "occurence" : null, "description" : "" } ], "returns" : { "type" : "empty-sequence()", "description" : "" }, "errors" : [ ] }, { "arity" : 2, "name" : "remove", "qname" : "cb:remove", "signature" : "($db as xs:anyURI, $key as xs:string*) as empty-sequence() external", "description" : " : Remove the values matching the given keys (xs:string) from the server. : : @param $db connection reference : @param $key the keys of the values that should be removed. : : @error cb:LCB0002 if any error occurs in the communication with : the server. : @return a empty sequence.\n", "summary" : ": Remove the values matching the given keys (xs:string) from the server.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "db", "type" : "xs:anyURI", "occurence" : null, "description" : "" }, { "name" : "key", "type" : "xs:string", "occurence" : null, "description" : "" } ], "returns" : { "type" : "empty-sequence()", "description" : "" }, "errors" : [ ] }, { "arity" : 3, "name" : "touch", "qname" : "cb:touch", "signature" : "($db as xs:anyURI, $key as xs:string*, $exp-time as xs:integer) as empty-sequence() external", "description" : " : Refresh the expiration time of the given keys. : : @param $db connection reference : @param $key the keys to touch : @param $exp-time new expieration time in seconds : : @error cb:LCB0002 if any error occurs in the communication with : the server. : : @return a empty sequence.\n", "summary" : ": Refresh the expiration time of the given keys.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "db", "type" : "xs:anyURI", "occurence" : null, "description" : "" }, { "name" : "key", "type" : "xs:string", "occurence" : null, "description" : "" }, { "name" : "exp-time", "type" : "xs:integer", "occurence" : null, "description" : "" } ], "returns" : { "type" : "empty-sequence()", "description" : "" }, "errors" : [ ] }, { "arity" : 2, "name" : "view", "qname" : "cb:view", "signature" : "($db as xs:anyURI, $path as xs:string*) as object()*", "description" : " : Retrieve the content of existing views. : : @param $db connection reference : @param $path contains the string of a view path : (e.g. \"_design/test/_view/vies\"). : : @error cb:LCB0002 if any error occurs in the communication with : the server. : : @return a sequence of strings (as JSON) containing information of the views.\n", "summary" : ": Retrieve the content of existing views.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "db", "type" : "xs:anyURI", "occurence" : null, "description" : "" }, { "name" : "path", "type" : "xs:string", "occurence" : null, "description" : "" } ], "returns" : { "type" : "object()*", "description" : "" }, "errors" : [ ] }, { "arity" : 3, "name" : "view", "qname" : "cb:view", "signature" : "($db as xs:anyURI, $path as xs:string*, $options as object()) as object()*", "description" : " : Retrieve the content of existing views. : : @param $db connection reference : @param $path contains the string of a view path : (e.g. \"_design/test/_view/vies\"). : @param $options JSONiq object with additional options : : @option Json object whith options for the querying the view. available options: : \"encoding\" string with the name of the encoding of the returned : strings (if not UTF-8). : \"stale\" option's value is a string with the type of stale to be used. : Valid values: : \"ok\" : the view is not updated : \"false\" : the view is updated before the function view is executed, : this options needs the key to be on disk before the call of the : view function. : \"update_after\" : the view is updated after the call of view : \"limit\" option's value is an integer which sets a number of how many : rows the view will show. : : @error cb:LCB0002 if any error occurs in the communication with : the server. : @error cb:CB0007 if any of the options is not supported. : : @return a sequence of strings (as JSON) containing information of the views.\n", "summary" : ": Retrieve the content of existing views.
", "annotation_str" : " %an:sequential", "annotations" : [ { "prefix" : "an", "ns" : "http://zorba.io/annotations", "name" : "sequential", "value" : "" } ], "updating" : false, "parameters" : [ { "name" : "db", "type" : "xs:anyURI", "occurence" : null, "description" : "" }, { "name" : "path", "type" : "xs:string", "occurence" : null, "description" : "" }, { "name" : "options", "type" : "object()", "occurence" : null, "description" : "" } ], "returns" : { "type" : "object()*", "description" : "" }, "errors" : [ ] } ], "variables" : [ ] }