Getting "Command find failed: Feature not supported" in .NET from AWS DocumentDb - mongodb-.net-driver

I am calling myCollection.Find(_ => true) in C# and getting this exception.
What can be wrong? What's not supported?
db.MyDocs.find() in mongosh works fine...
MongoDb.Driver 2.19.0,
DocumentDb engine version 4.0.0

Apparently, this is what happened:
the .NET driver translated the 'find' method call into the following MongoDB command:{ "find" : "MyDocs", "filter" : { "$expr" : true } }
and DocoumentDB indeed does not support the $expr operator.
Took quite a while to figure out...

Related

Connecting a db2 database from a centos hosted laravel application

I'm trying to connect to a db2 database server (iseries ibm) from my laravel application (5.8). The application is running on a centos linux server.
I saw that db2 isn't in the 4 databases types listed here : https://laravel.com/docs/5.8/database#introduction.
So I tried to use that package https://github.com/cooperl22/laravel-db2 but I got the followings errors :
Undefined class constant 'I5_ATTR_DBC_SYS_NAMING'
And I've got the errors for 5 constants :
PDO::I5_ATTR_DBC_SYS_NAMING, PDO::I5_ATTR_COMMIT, PDO::I5_ATTR_JOB_SORT, PDO::I5_ATTR_DBC_LIBL, PDO::I5_ATTR_DBC_CURLIB.
Also, if I comment theses constants, I got this error :
`Syntax error: -104 [IBM][CLI Driver][AS] SQL0104N An unexpected token "<END-OF-STATEMENT>" was found following "". Expected tokens may include: "( + - ? : DAY INF NAN RID ROW RRN". SQLSTATE=42601 (SQLNumResultCols[-104] at /root/PDO_IBM-1.3.6/ibm_driver.c:153) (SQL: select * from )`
I'm using the db2_ibmi_ibm driver.
Here is my php info linked to the driver :
EDITED :
php version is 7.3.4
centos version is 7
Also I made a from scratch php script running and I can get the results from a query using the db2_connection method. So I'm pretty sure it's PDO related :-/
Ok I found the issue, my scheme and database were wrong, so the query wasn't correct.
The PDO constants are not needed in my case.
Thanks for your answers

FOSElasticaBundle which version of Elasticsearch?

I've just installed elasticasearch last version. Looks like this bundle doesn't support version 5.0.2? Cause I've got this error
[Symfony\Component\Debug\Exception\FatalThrowableError]
Wrong parameters for Elastica\Exception\ResponseException([string $message [, long $code [, Throwable $previous = NULL]]])
Which version of elasticasearch should I use?
Thanks
In my current project I run https://www.elastic.co/downloads/past-releases/elasticsearch-2-4-2 with "friendsofsymfony/elastica-bundle": "^3.1"

The constructor ClientArguments(String[], SparkConf) is undefined

I am trying spark-submit through Java code. I am referring the following example.
https://github.com/mahmoudparsian/data-algorithms-book/blob/master/misc/how-to-submit-spark-job-to-yarn-from-java-code.md
But I am getting
The constructor ClientArguments(String[], SparkConf) is undefined
My version of spark-yarn is spark-yarn_2.11-2.0.0.
I saw the topic :
spark-submit through java code
but it does not work for me.
Any help ?
The constructor arguments have changed between 1.x and 2.0. In 1.x it looked like:
ClientArguments(args: Array[String], sparkConf: SparkConf)
In 2.0 its:
ClientArguments(args: Array[String])
See: https://github.com/apache/spark/blob/branch-2.0/yarn/src/main/scala/org/apache/spark/deploy/yarn/ClientArguments.scala

How to use custom analyzer in ElasticSearch?

I wanted to try Elasticsearch with Polish language support, but I have some problems with it.
I installed Stempel Analysis Plugin, I'm trying to create an index that uses Polish analyzer:
curl -XPUT localhost:9200/polisz -d '{
"mappings" : {
"_default_" : {
"properties" : {
"text_entry" : { "type": "string", "analyzer": "polish" }
}
}
}
}
'
But I get an error about not recognized analyzer:
{
"status" : 400,
"error" : "MapperParsingException[mapping [_default_]]; nested: MapperParsingException[Analyzer [polish] not found for field [text_entry]]; "
}
Should I do anything after installing the plugin and rebooting ES?
I can't find any specific instructions about using the plugin so maybe I'm just doing something obviously wrong?
Some more details on how I set up my environment:
I installed and run docker image with ES and kibana by commands:
docker pull minimum2scp/es-kibana
docker run -d -p 8080:80 -p 9200:9200 --name es minimum2scp/es-kibana
I installed the Stempel plugin by command:
host$ docker exec -it es bash
root#docker-es:/# /usr/share/elasticsearch/bin/plugin install elasticsearch/elasticsearch-analysis-stempel/2.4.2
Then I rebooted elasticsearch, by:
root#docker-es:/# service elasticsearch restart
I'll be grateful for any help!
Krzysztof
OK, I got it. It seems that my plugin didn't install correctly. Even that plugin install command doesn't return any errors, neither elasticsearch restart command, there was a Lucene version mismatch in Elasticsearch( I don't remember, but below 4.10.2) and the plugin (4.10.3).
It was enough to look into elasticsearch.log file to find it out...My bad.
BUT there is more to it: I switched to the most popular (by stars) elasticsearch docker image, which is: dockerfile/elasticsearch. It has the ES version 1.4.2 that is based on Lucene 4.10.2, still mismatching the plugin Lucene 4.10.3. That causes an error even though authors of plugin states it plugin in 2.4.2 (current stable) support 1.4 ES version(s).
Citing an error for future web searching the problem:
[2015-02-13 10:57:11,850][INFO ][node ] [Necromantra] version[1.4.2], pid[1], build[927caff/2014-12-16T14:11:12Z]
[2015-02-13 10:57:11,851][INFO ][node ] [Necromantra] initializing ...
[2015-02-13 10:57:11,884][ERROR][plugins ] [Necromantra] cannot start plugin due to incorrect Lucene version: plugin [4.10.3], node [4.10.2].
[2015-02-13 10:57:11,884][WARN ][plugins ] [Necromantra] failed to load plugin from [jar:file:/data/plugins/analysis-stempel/elasticsearch-analysi
s-stempel-2.4.2.jar!/es-plugin.properties]
Now I chose a path to downgrade the plugin to 2.4.1, which agreed with my ES 1.4.2. Although in the long term I would look for docker image that has 1.4.3 ES which, hopefully,upgraded Lucene version as well.
Dadoonet, thank you for having a closer look on my problem.

gcutil --filter arguments error

Encountered a problem trying to run gcutil listinstances --filter="name eq foo" (for example...)
I get the following error:
RuntimeError: CommandError: Unknown argument: "eq", "foo"
This follows the examples found in the official usage tips.
Seems as if 'eq' and 'foo' get parsed as independent arguments for gcutil...
Does this result from a bug in gcutil or the way I use it?
Thanks.
Looks like an installation issue. Did you try reinstalling Google Cloud SDK?

Resources