Gremlin: text searching predicates not working on OrientDB - orientdb

I have the below query on OrientDB:
g.V().hasLabel('people').has('firstName',startingWith('V')).values('ID')
And I am getting a "Failed executing Gremlin query" response. I know there are 'people' with first name that start with "V", but even if there weren't it should return empty results. Any ideas why this could be happening?

You are probably running OrientDB version 3.0.x which is aligned to Gremlin 3.3.x.
These new text predicates, like startingWith, where added in Gremlin 3.4.x, and available in OriendDB version 3.1.x, which is currently in milestone preview.

Related

Does Apache AGE support Indexing on Nodes/Relationships?

Is it possible to create an index on the nodes/relationships of a graph in AGE? If so, what is the syntax?
I was unable to find anything about it in the documentation.
There is an issue currently open related to this:
https://github.com/apache/age/issues/45
At this moment seems there no complete support for this. There is an Open PR for OpenCypher as well:
https://github.com/opencypher/openCypher/pull/166
If however you are okay with Neo4j you can look into it.
For more information regarding implementation in Cypher queries: https://github.com/Mats-SX/openCypher/blob/c542f94f07fb934254748f4f2ce44612d45866a3/cip/vendor-extensions/neo4j/CIP2016-12-14-Neo4j-indexes.adoc

List all the query shapes in mongo database or collection

I was going through the documentation on the official site, where I happened to find out the term query-shape while browsing details over the indexes section.
The details look interesting and quite possibly a list of these could help me with all possible queries that are being raised to a cluster while I am planning to onboard an existing deployed application.
But the question that I have now is that is there a way to do the above on the command line for a collection(or complete database)?
As a side note, I use both compass community and robo3t as tools built over CLI to access the datastore and as well comfortable to run the command on mongo shell directly too.
With some more time and effort, I could find PlanCache.listQueryShapes which was a slight variation towards the more recent version of mongo which I was using.
Seemingly the $planCacheStats introduced in 4.2 was something I was looking forward to. The following query helped me list all the query shapes over a collection as mentioned in the list query shapes section.
db.user_collections.aggregate( [ { $planCacheStats: { } } ,
{ $project: {createdFromQuery: 1, queryHash: 1 } } ] )

Can I use JSON_EXTRACT in a Domo SQL DataFlow

Domo calls one of the DataFlow types a "MySQL DataFlow". MySQL has a function called JSON_EXTRACT. How can I use this on a field that contains some JSON encoded data? I receive back the error:
The database reported a syntax error. FUNCTION json_extract does not exist
I know this is a somewhat old question, but I think the answer is that Domo uses an older version of MySQL (5.6) that does not support the JSON_EXTRACT function (5.7 and later).
You can check the version by running this statement in a MySQL DataFlow transformation step:
SELECT VERSION();
When I run that on the Domo instance I use at work I see 5.6.28-76.1-56
If you go to the JSON Functions page of the MySQL documentation and try to select any version before 5.7 from the dropdown in the upper right of the page you will see a message saying "The page you are viewing does not exist in version X.X"

OrientDB No edge created Execption

I am currently getting a "No edge created" exception while using OrientDB 2.1
As per the CREATE EDGE documentation (http://orientdb.com/docs/2.1/SQL-Create-Edge.html):
Beginning with version 2.1, when no edges are created OrientDB throws
a OCommandExecutionException error. This makes it easier to integrate
edge creation in transactions. In such cases, if the source or target
vertices don't exist, it rolls back the transaction.
I was wondering if there was some way to log/print out information regarding the vertices it is trying to create an edge between. I am using a JSON file to query for updates from a DB and transformer inside that JSON to create the edges using the IDs as parameters of the query results. Thanks
I solved my issue of getting ID information of the vertices by adding "log": "debug" to the JSON file.

JacksonDBDecoder - Server errors from MongoDB - mongojack 2.3.0

I have a problem when my application receives an error from MongoDB server, for example:
Imagine that I do a find in MongoDB but the response from MongoDB Server is an error because of a timeout:
{
$err: "MongoTimeout due to...bla bla bla..."
code: 50
}
JacksonDBDecoder is expecting my Java type for example my class "Stuff" (that contains several fields like "price" and "weight"), but when it receives the previous JSON, then there is not any matching fields with "price" and "weight", so the outcome is empty: { }
The empty JSON will be processed by the mongo-java-driver classes (com.mongodb.QueryResultIterator.throwOnQueryFailure exactly) and it will never log the original information "MongoTimeout due to...bla bla bla..." and 50, because the decoder could not understand the JSON from MongoDB Server.
Could you help me to configure mongojack or Jackson to handle this types of responses from MongoDB Server?
Many thanks.
Regards,
Paco.
After talking with MongoDB support, they confirmed to me the following:
"The driver team read our last comments and they believe this is indeed a driver bug. Basically, they think the driver should detect that this is a query failure and use the default decoder to decode the error document rather than the custom decoder registered by MongoJack.
The most relevant part is that this bug does not exist in the 3.x driver series. So our suggestion for you is to upgrade to the 3.2.2 driver (note that MongoJack lists the 3.2 Java driver as its preferred dependency: http://mongojack.org/dependencies.html)."
So, it is not an mongojack issue ;)
Regards,
Paco.