Comments (5)
π This issue has been resolved in version 1.6.0-beta.1 π
The release is available on GitHub release
Your semantic-release bot π¦π
from typedorm.
π This issue has been resolved in version 1.7.0 π
The release is available on GitHub release
Your semantic-release bot π¦π
from typedorm.
Hi @whimzyLive
Just wanted to understand the exact behavior of isSparse
From documentation:
(property) isSparse?: boolean
DynamoDB only adds item to index if both Partition Key and Sort Key defined for any given GSI contains value
Indexes missing sort key value will not be added to index.
However, when I define false for a sparseIndex I expect undefined/optional values to be allowed for sort key
GSI2: {
partitionKey: 'COMPANY#{{companyId}}',
sortKey: 'DEPT#{{deptId}}',
type: INDEX_TYPE.GSI,
isSparse: false,
},
...
@Attribute()
companyId: string;
@Attribute()
deptId?: string;
...
This is not working though when I try to create a new user with companyId defined but deptId empty.
I get the following error:
"deptId" was referenced in DEPT#{
{deptId
}
} but it's value could not be resolved.
Additionally, if i define a default value for deptId, the same error occurs, so it appears as if the code here is running before default value is set.
@Attribute({
default: '',
})
deptId?: string;
So my question is what exactly is the expected behavior when isSparse: false?
from typedorm.
As a followup to my previous comment, I observed the opposite behavior with the same entity but a different index:
GSI3: {
partitionKey: 'COMPANY#{{companyId}}',
sortKey: {
alias: 'officeStatus',
},
type: INDEX_TYPE.GSI,
},
...
@Attribute({
default: OfficeStatus.REMOTE,
})
officeStatus: OfficeStatus;
...
When I create a user and leave officeStatus undefined it will create the default value for me and will not throw any error like the one from the previous comment. Querying then with PK = companyId and officeStatus = remote works and returns users
from typedorm.
I'm running into the same issue as @michael-pont mentioned above. Please allow sort keys to be optional when defining GSIs on a table.
from typedorm.
Related Issues (20)
- Is there support for complex types (Sets and Maps)?
- Transaction failing when updating entity with unique item and not updating unique value HOT 1
- Updating entity with unique item and fail
- Unable to query anything from DynamoDB
- Bundling error with serverless-bundle HOT 1
- I can update "number" fields but I canΒ΄t create them
- Support column name alias mapping
- "No such connection with name \"default\" exists" or "Connection Already Exists" HOT 2
- Can I remove (update in general) nested attributes? HOT 2
- Add support for LSI/GSI to EntityManager.findOne() HOT 1
- @TransformToDynamo and @TransformFromDynamo not being called HOT 2
- Update TRANSACTION_WRITE_ITEMS_LIMIT to properly reflect Dynamo DB Transaction Limit HOT 1
- Setting values in a map attribute
- Attribute auto generation fails if typescript flag `useDefineForClassFields` is true HOT 1
- Support gentle fallback for codebases that cannot use emitDecoratorMetadata HOT 1
- Updating item SET IF_NOT_EXISTS and LIST_APPEND expected behavior
- WriteTransaction cancellation reasons not properly handled
- Does TypeDORM Support Write Sharding for DynamoDB? HOT 1
- EntityManager.find() with filter+limit can spawn thousands of recursive sequential queries HOT 2
- When update, decorated transformations on the primary key attributes are not applied.
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 typedorm.