diff --git a/node.js/core-services.md b/node.js/core-services.md index ef88b2d81..205900800 100644 --- a/node.js/core-services.md +++ b/node.js/core-services.md @@ -1072,20 +1072,20 @@ As an alternative to [`srv.run(query)`](#srv-run-query) you can use these conven - srv. **read** (entity, ...) {.method} - srv. **create** (entity, ...) {.method} -- srv. **insert** (entity, ...) {.method} -- srv. **upsert** (entity, ...) {.method} +- srv. **insert** (...).into(entity) {.method} +- srv. **upsert** (...).into(entity) {.method} - srv. **update** (entity, ...) {.method} - srv. **delete** (entity, ...) {.method} Essentially, they start constructing *bound* [`cds.ql` query objects](cds-ql) as follows: ```js -srv.read('Books',...)... --> SELECT.from ('Books',...)... -srv.create('Books',...)... --> INSERT.into ('Books',...)... -srv.insert('Books',...)... --> INSERT.into ('Books',...)... -srv.upsert('Books',...)... --> UPSERT.into ('Books',...)... -srv.update('Books',...)... --> UPDATE.entity ('Books',...)... -srv.delete('Books',...)... --> DELETE.from ('Books',...)... +srv.read('Books',...)... --> SELECT.from ('Books',...)... +srv.create('Books',...)... --> INSERT.into ('Books',...)... +srv.insert(...).into('Books')... --> INSERT.into ('Books',...)... +srv.upsert(...).into('Books')... --> UPSERT.into ('Books',...)... +srv.update('Books',...)... --> UPDATE.entity ('Books',...)... +srv.delete('Books',...)... --> DELETE.from ('Books',...)... ``` You can further construct the queries using the `cds.ql` fluent APIs, and then `await` them for execution thru `this.run()`. Here are some examples: