-
Notifications
You must be signed in to change notification settings - Fork 57
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Modeling help request #148
Comments
I can take a look at this more closely tonight 👍 |
Thanks in advance! I think what I need is to create a service to manage the join. |
@aisflat439 I checked out your Playground (thank you for doing that btw, it is very helpful) and it looked like the error was that the Can you verify if this is what you'd expect? |
Just to chime in ... this is actually very helpful for me getting started with M2M relations, maybe this should be part of the documentation some time? Also a question: I have almost the same situation BUT need to query on const WarehouseEntity = new Entity(
// ...
indexes: {
warehouses: {
collection: "warehouses",
pk: {
field: "pk",
composite: ["warehouseId"],
},
sk: {
field: "sk",
composite: [],
}
},
// ...
}); And then the very basic function: async function getWarehouse(warehouseId: string) {
return await WarehouseEntity.get({ warehouseId }).go();
} Now my question: is this indeed the right approach for this access pattern or doesn't it matter at all? |
Hey Tyler.
I looked high and low for this in the README and in
/examples
. It seems like it should be straightforward.I wanted to model the following:
Creating the top half of the model was easy. I then applied what I know about creating comments on a post or tickets on a project to
addProductToWarehouse
but I was immediately stumped. Can you offer some assistance when you have some time? It's not obvious to me how this should work.https://electrodb.fun/?#code/PQKgBAsg9gJgpgGzARwK5wE4Es4GcA0YuccYGeqCALgUQBYCG5YA7llXWAGbZwB2MXGBDAAUKKwBbAA5QMVMAG8wAUT5V2AT0IBlTADcsAY1IBfbhiiSwAIkRwjVSzABGNgNzijUPrgVUGFwRSAF5bTShUDAB9AKC4aL4GSTgPcTgAD1l5MG9fBQAFZ1RHNQ0qTTAwvjgWVXUtAAowUTAlVrawSVhEAC52zs79TFwsH36bAEYbfA7B-nLNCaLYEqoZuc7iDEMTCbl4DFwNwdNZwYYqJywXVCo8fsVNtulixwBJGEfnzorpOAmfmwfAA5idBp1yGgsOQvmAnOhzhCzj8kilvhDfpp-oDrqDwZioagYXA4Qi4EjTpTOvBcEZsNINOMBpj4diAbYgV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