Comments (1)
I tested this one and it looks like you can pass an array of strings for the field names:
const result = await this.certificatesRepository.create(
certificate,
{
fields: [ "a", "b", "c" ]
}
);
The loopback-style syntax would require the "fields" to be remapped here:
loopback-next/extensions/sequelize/src/sequelize/sequelize.repository.base.ts
Lines 170 to 176 in 56201c5
For example (note that the existing buildSequelizeAttributeFilter has a Typescript interface conflict with the create
parameters):
async create(entity: DataObject<T>, options?: AnyObject): Promise<T> {
const data = await this.sequelizeModel.create(
entity as MakeNullishOptional<T>,
{
...options,
fields: this.buildSequelizeAttributeFilter(options?.fields),
},
);
return new this.entityClass(data.toJSON()) as T;
}
from loopback-next.
Related Issues (20)
- [@loopback/sequelize] Scope setting on Loopback Model is ignored by Sequelize extension
- @loopback/rest - v13.1.3 request validation fails
- [@loopback/sequelize] Test sandbox directory is included in the published NPM package
- [@loopback/sequelize] Typescript error when using the "required" property with Sequelize HOT 2
- Polymorphic relations broke SQL Transactions HOT 5
- Error when running `npm run tsdocs`
- @loopback/repository 6.1.4 broke hasManyThrough relations HOT 4
- [@loopback/sequelize] contains & match (extendedOperators) are not working HOT 1
- [@loopback/sequelize] SQL select error if an empty string "order" is passed to SequelizeRepository find / findOne methods
- ESLint: naming convention errors on certain third-party imports
- @loopback/sequelize:modify the regular expression to match a select query with parentheses
- Dockerfile improvements HOT 3
- [BOOT] Not possible to import ESM project files HOT 2
- [@loopback/sequelize] Unable to order by associations using "order" filter
- [@loopback/sequelize] syncSequelizeModel error for models having property type array & item-type object HOT 3
- lb4 controller fails with type BASIC HOT 2
- [@loopback/sequelize] Hidden properties configuration is not applied to nested model relations
- [bug] getting "HTTP/1.1 501 Not Implemented" HOT 4
- Loopback/rest stringifies the responce which takes time and hangs the app HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from loopback-next.