Bug #97663 Connector nodejs tutorial code have a syntax error
Submitted: 16 Nov 2019 4:09 Modified: 17 Jan 2023 17:08
Reporter: Mitani Satoshi (OCA) Email Updates:
Status: Closed Impact on me:
None 
Category:Connector for Node.js Documentation Severity:S3 (Non-critical)
Version:8.0.18 OS:Any
Assigned to: CPU Architecture:Any

[16 Nov 2019 4:09] Mitani Satoshi
Description:
this code have a below syntax error. semicolon at the end of bind() is unnesessary. 
https://dev.mysql.com/doc/dev/connector-nodejs/8.0/tutorial-Getting_Started.html

.then(() => {
    return session.getSchema('mySchema').getCollection('myCollection')
        .modify('age = :value')
        .bind('value', 42);
        .set('name', 'bar')
        .execute();
})

How to repeat:
$ node tutorial.js
SyntaxError: Unexpected token .
    at Module._compile (internal/modules/cjs/loader.js:760:23)
    at Object.Module._extensions..js (internal/modules/cjs/loader.js:827:10)
    at Module.load (internal/modules/cjs/loader.js:685:32)
    at Function.Module._load (internal/modules/cjs/loader.js:620:12)
    at Function.Module.runMain (internal/modules/cjs/loader.js:877:12)
    at internal/main/run_main_module.js:21:11

Suggested fix:
fix the code
[17 Nov 2019 5:34] MySQL Verification Team
Hello Mitani,

Thank you for the report and feedback.
Verified as described.

regards,
Umesh
[17 Jan 2023 17:08] Rui Quelhas
Thank you for your bug report. This issue has already been fixed in the latest released version of that product, which you can download at

  http://www.mysql.com/downloads/