MySQL Blog Archive
For the latest blogs go to blogs.oracle.com/mysql
MySQL Connector/Node.js 8.0.11 GA has been released

MySQL Connector/Node.js is a new Node.js driver for use with the X DevAPI. This release, v8.0.11, is the first general availability release of the MySQL Connector/Node.js 8.0 series.

The X DevAPI enables application developers to write code that combines the strengths of the relational and document models using a modern, NoSQL-like syntax that does not assume previous experience writing traditional SQL.

MySQL Connector/Node.js can be downloaded through npm (see https://www.npmjs.com/package/@mysql/xdevapi for details) or from https://dev.mysql.com/downloads/connector/nodejs/.

To learn more about how to write applications using the X DevAPI, see http://dev.mysql.com/doc/x-devapi-userguide/en/. For more information about how the X DevAPI is implemented in MySQL Connector/Node.js, and its usage, see http://dev.mysql.com/doc/dev/connector-nodejs/.

Please note that the X DevAPI requires at least MySQL Server version 5.7.12 or higher with the X Plugin enabled. For general documentation about how to get started using MySQL as a document store, see http://dev.mysql.com/doc/refman/5.7/en/document-store.html.

Changes in MySQL Connector/Node.js 8.0.11 (2018-04-19, General
Availability)

Functionality Added or Changed

  • The protobuf.js library was replaced with the official google-protobuf npm package.
  • Added NOWAIT and SKIP_LOCKED support to the lockShared() and lockExclusive() methods. Example usage: lockShared(mysqlx.LockContention.SKIP_LOCKED).
  • Added the X DevAPI SHA256_MEMORY authentication mechanism.
  • Auto-generated document _id values generated by the MySQL server, introduced in MySQL Server 8.0.11, are now supported.

Bugs Fixed

  • Running a select query against a table containing BIGINT values and using those values as filtering criteria could fail to function. This was because those values were converted to JavaScript numbers when encoding the protobuf message, and lost precision since the maximum safe integer in JavaScript is 2^53 – 1. (Bug #27570761)
  • Row values from columns using the FLOAT type were not rounded according to the maximum number of displayable decimal digits defined by the schema. For example, a column with type FLOAT(3,2) containing a value of 1.23456789 would display as 1.2300000190734863 instead of the expected 1.23. (Bug #27570541)
  • Row values from columns using the BIT (http://dev.mysql.com/doc/refman/5.7/en/bit-type.html) data type were decoded as their sign integer counterpart instead of unsigned values. For example, b’111′ was decoded as -4 instead of 7. (Bug #27570462)
  • Row values for columns of any type of UNSIGNED integer (TINYINT, SMALLINT, MEDIUMINT, INT or BIGINT) were being interpreted by the connector as their SIGNED integer value counterpart. (Bug #27570342)
  • The sort() method was added to the following operations: CollectionFind, CollectionRemove, and CollectionModify. (Bug #27429922)
  • While adding a document, the expression parser was rejecting valid escaped literally strings that constituted properties of the document, and it threw unexpected errors. (Bug #27429852)
  • Messages split into multiple fragments (either because they exceeded the MTU or the maximum size of V8 buffers) were improperly reconstructed and could not be decoded. This behavior would throw an error similar to “Uncaught SyntaxError: Unexpected token”. (Bug #27429429)
  • Several methods returned plain JavaScript objects that now return iterable arrays. Schema.getCollections() now returns an array of Collection instances, Schema.getTables() now returns an array of Table instances, and Session.getSchemas() now returns an array of Schema instances. (Bug #27294362, Bug #27221114)
  • The expression parser was executed every time a document was added but now requires mysqlx.expr() to be explicitly called. For example, before collection.add({ name: ‘foo’ }) would parse the “name” property. Now, to parse it, use collection.add({ name: mysqlx.expr(‘”foo”‘) }). (Bug #27177864)

Enjoy and thanks for the support!