0

I'm testing MySql 8 "XDevApi" with Nodejs, and I'm trying to modify a field in a document

Here is the code :

let vModifyOp=await vCollection.modify('_id = "000062817c620000000000000001"').set('wName','toto');
  • I don't have any errors or exceptions
  • vCollection is a "MySql xDev collection" , "vCollection.getOne" is working fine
  • Of course, the document exist

What Am I doing wrong ?

1 Answers1

0

Finally I found the solution by myself. We have to call vModifyOp.execute, so the code will be :

let vModifyOp=await vCollection.modify('_id = "000062817c620000000000000001"').set('wName','toto');
vModifyOp.execute();

But the "execute" is not specified in the official documentation concerning the "collection.modify"

Kuro Neko
  • 795
  • 12
  • 19