Couchbase web admin console document filter start key filter - wildcard

I am using the couchbase web admin console. I have some document with the key as jid::xxxx::device, where xxxx is a number. If I want to list all the documents with this key, does the couchbase document filter start key have the wildcard like if I type jid::*::device, the all the document with this pattern can be listed.
Thanks

startkey filtering, in CB server 5, is available as CLASSIC EDITOR:

You can't do this in the web UI, but you can do it with the N1QL developer preview.
Download DP4 (http://www.couchbase.com/nosql-databases/downloads - scroll down to pre-release) and follow the installation instructions to point cbq-engine to your Couchbase Server address.
Run the repl (cbq -engine=http://location-of-cbq-engine) and create a primary index for the bucket, so you can query it ("CREATE PRIMARY INDEX ON <bucket_name>;")
"SELECT * FROM <bucket_name> WHERE META(<bucket_name>).id LIKE "jid::%::device";
This should actually have decent performance even on the developer preview, because you have an index on the document keys.

Related

what version of mysql are datasources using?

I have a calculated table that uses a join statement SQL query as its data source. good. Works fine.
But then I'm trying to add in the use of :Parameters and my attempts to create a default if it equals null are not working.
I tried this (In the onLoad client script):
if (app.datasources.Relations.query.parameters.x== null){
console.log("No xfound,using >");
app.datasources.Relations.query.parameters.x= ">";}
It works, but not on the initial load (it appears to apply AFTER the first load).
So I decided to try and bake it into the sql statement that makes the table like this, but all three of these iterations failed with "check your version of mysql" errors.
AND b.CSI_Code REGEXP select if(:x= null, "<",:x)
AND b.CSI_Code REGEXP select if(:x== null, "<",:x)
AND b.CSI_Code REGEXP select if(:x=== null, "<",:x)
I've got a workaround going where I set my parameters to the APP onload rather than the datasource onload,but ultimately I think it would be cleaner if I could get the SQL if nul set to default (">") part working.
If you have access to the Google Cloud Platform where your database is hosted, it lists the database version in the instance information (see picture). Per the FAQ, the options are currently MySQL 5.5, 5.6, or 5.7. If you click into the instance, and go to the Databases tab, each app has its own database with a name like "Wc7cVzeGEvbPjxj4". To confirm which database your app uses, the name should be listed in your Google App Maker app under (Your app in the developer GUI) > Settings Cog Icon > Database > Database Key.

Scopus api wrong

I use this to test if I can retrieve references from a paper using doi from rscopus package
I use this:
library(rscopus)
library(dplyr)
auth_token_header("please_add")
akey="please_add"
object_retrieval("10.1109/ISCSLP.2014.6936630", ref = "doi")
but I receive this error:
Error in get_api_key(api_key, error = api_key_error) :
API key not found, please set option('elsevier_api_key_filename') or option('elsevier_api_key') for general use or set environment variable Elsevier_API, to be accessed by Sys.getenv('Elsevier_API')
Why do I receive it?
Please follow the steps I outlined in the section of https://github.com/muschellij2/rscopus#steps-to-get-api-key
Which is posted below:
In order to use this package, you need an API key from https://dev.elsevier.com/sc_apis.html. You should login from your institution and go to Create API Key. You need to provide a website URL and a label, but the website can be your personal website, and agree to the terms of service.
Go to https://dev.elsevier.com/user/login. Login or create a free account.
Click "Create API Key". Put in a label, such as rscopus key. Add a website. http://example.com is fine if you do not have a site.
Read and agree to the TOS if you do indeed agree.
Add Elsevier_API = "API KEY GOES HERE" to ~/.Renviron file, or add export Elsevier_API=API KEY GOES HERE to your ~/.bash_profile.
Alternatively, you you can either set the API key using rscopus::set_api_key or by options("elsevier_api_key" = api_key). You can access the API key using rscopus::get_api_key.
You should be able to test out the API key using the interactive Scopus APIs.
A note about API keys and IP addresses
The API Key is bound to a set of IP addresses, usually bound to your institution. Therefore, if you are using this for a Shiny application, you must host the Shiny application from your institution servers in some way. Also, you cannot access the Scopus API with this key if you are offsite and must VPN into the server or use a computing cluster with an institution IP.
See https://dev.elsevier.com/tecdoc_api_authentication.html

GCP encryption thru Beam / Dataflow APIs for Bigquery and Cloud SQL

Context: We are trying to load some CSV format data into GCP BigQuery using GCP Dataflow (Apache Beam). As a part of this for the first time (for each table) creating the BQ tables thru BigQueryIO API. One of the customer requirement is the data on GCP needs to be encrypted using Customer supplied/managed Encryption keys.
Problem Statement: We are not able to find any way to specify the "Custom Encryption Keys" thru APIs while creating Tables. The GCP documentation details about how to specify the Custom encryption keys thru GCP BQ Console but could not find anything for specifying it thru APIs from within DataFlow Code.
Code Snippet:
String tableSpec = new StringBuilder().append(PipelineConstants.PROJECT_ID).append(":")
.append(dataValue.getKey().target_dataset).append(".").append(dataValue.getKey().target_table_name)
.toString();
ValueProvider<String> valueProvider = StaticValueProvider.of("gs://bucket/folder/");
dataValue.getValue().apply(Count.globally()).apply(ParDo.of(new RowCount(dataValue.getKey())))
.apply(ParDo.of(new SourceAudit(runId)));
dataValue.getValue().apply(ParDo.of(new PreProcessing(dataValue.getKey())))
.apply(ParDo.of(new FixedToDelimited(dataValue.getKey())))
.apply(ParDo.of(new CreateTableRow(dataValue.getKey(), runId, timeStamp)))
.apply(BigQueryIO.writeTableRows().to(tableSpec)
.withSchema(CreateTableRow.getSchema(dataValue.getKey()))
.withCustomGcsTempLocation(valueProvider)
.withCreateDisposition(BigQueryIO.Write.CreateDisposition.CREATE_IF_NEEDED)
.withWriteDisposition(BigQueryIO.Write.WriteDisposition.WRITE_APPEND));
Query: If anybody could let us know
If this is possible to provide encryption key thru Beam API?
If its not possible with the current version what could be the possible work
around?
Kindly let know if additional information is required.
Customer supplied encryption keys is a new feature, not all libraries have been updated to support it yet.
If you know the table name in advance, you can use UI/CLI or API to create table, then run your normal flow to load data into that table. That might be a work around for you.
https://cloud.google.com/bigquery/docs/customer-managed-encryption#create_table
API to create table: https://cloud.google.com/bigquery/docs/reference/rest/v2/tables/insert
You need to set this section on table object:
"encryptionConfiguration": {
"kmsKeyName": string
}
More details on table: https://cloud.google.com/bigquery/docs/reference/rest/v2/tables#resource

Issue with XPage access to documents from another database

I have 2 databases in one server, a Web App db containing XPages only, and another database containing documents. When I tried to open a document in Xpage, an error appears saying that I don't have access to the document (I did a checking using db.queryAccess(myUserName) and found out that I don't have access to the document database, even though my user name is specified directly as Manager). I created a new copy of the document database, then points my web app db to that. Here I have access to the documents! I had implemented this before and this is the first time I had this problem. What are the probable problem(s) with my original document database? I already did a fixup and compacting, but to no avail. Please help me... Thanks!
Please check the the "Maximum Internet name and password" option in the ACL settings. This option overrides every ACL entry: If you are Manager but the option is set to "No Access" - you have no access.

Query table from another ms sqlserver

I'm really not a database person, so forgive me if this question.
I'm using Visual Studio 2008 and I am trying to view tables on another server database.
Example:
I have my aspnetdb.mdf database, and my anaylsis.mdf database.
What I am trying to do within Visual Studio is read table columns that are inside aspnetdb.mdf from anaylsis.mdf.
How is this done?
Thanks
In order to have access to any object in other server, you need to create a linked server to that server as below:
in your aspnetdb go to server Objects -> Linked Servers ->Right click -> new linked servers .
a window will be opened that you have to fill the information in the general tab as below:
Linked Server: anaylsisDB
Server Type: otherdata source
Provider: SQL Native Client
ProductName :SQL
Data source: anaylsis(This is the server name which you want to connect to)
After you finished with this tab, in the left side of the page goto secutity tab and fill the information as below:
In the bottom of the page select be made using this secutity content and insert the anaylsis server username and password.
click ok and now you have made a linked server to the anaylsis. so you can use any objects in anaylsis with this format:
anaylsisDB.[Databasename].dbo.[tableName]
or
anaylsisDB.[Databasename].dbo.[ViewName]
Here anaylsisDB is the name of the linked server that we have made to the anaylsis server.
SELECT * FROM [linkedServer].[database].[dbo].[someTable]
You find some usefull information in the T-SQL Documentation on MSDN:
If the table or view exists outside the instance of SQL Serverl, use a four-part name in the form linked_server.catalog.schema.object. For more information, see sp_addlinkedserver (Transact-SQL).
Source:
http://msdn.microsoft.com/en-us/library/ms177634(v=SQL.100).aspx#c089161a-53bf-46d4-a2da-51252dd10e3f_c
A useful way to do that is to use VIEWS, you create view with DATAS from other databases and use it like a kind of table in your Database..
MSDN
You can either setup a linked server on the the same server you are running the sp on which will give it an alias i.e.
select *
from Server2.Database2.dbo.SomeTable
Or you can use the OpenRowset command. I always try and use the Linked server option although, the OpenRowset is useful if you don't have server admin access.
Both are obviously dependant on the servers being able to communicate ok.

Resources