MySQL Forums
Forum List  »  Connector/Node.js

Re: Value expression strings on relational table update
Posted by: Rui Quelhas
Date: February 04, 2021 08:41AM


please ignore my previous message. The expression parser operates in DOCUMENT mode by default. In this case, what you want is TABLE mode, so you need to provide that option to "mysqlx.expr()".

In your example, you need to use

.set('age', mysqlx.expr('age + 1', { mode: mysqlx.Mode.TABLE })

This is probably not easy to understand from the documentation, so maybe you can actually report a bug about that.

I don't know what the Shell does exactly but it definitely creates the expression in table mode, which, in that case, might be the default mode or not (I would have to investigate further).

Hope it helps.

Options: ReplyQuote

Written By
Re: Value expression strings on relational table update
February 04, 2021 08:41AM

Sorry, you can't reply to this topic. It has been closed.

Content reproduced on this site is the property of the respective copyright holders. It is not reviewed in advance by Oracle and does not necessarily represent the opinion of Oracle or any other party.