Skip to content
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

update by secondary index does not update the primary value #44

Open
dvv opened this issue Dec 18, 2023 · 1 comment
Open

update by secondary index does not update the primary value #44

dvv opened this issue Dec 18, 2023 · 1 comment

Comments

@dvv
Copy link

dvv commented Dec 18, 2023

await db.offices.update({
  where: { name: "o1" },
  data: {
    address: "o1a",
  },
})
console.log(
  await db.offices.findMany({ where: { name: "o1" } })
)
// GOOD: [{ id: "XXX", address: "o1a", ... }]
console.log(
  await db.offices.findMany({ where: {} })
)
// BAD: [{ id: "XXX", ... }]

Is that intended?

@dvv dvv changed the title update by secondary index does not updates the primary value update by secondary index does not update the primary value Dec 18, 2023
@skoshx
Copy link
Owner

skoshx commented Dec 18, 2023

Hey, this is definitely a bug, so thanks for opening this issue :)

Things like this is precisely why I opened #43 -- we should really rewrite the implementation.

I'll leave this open for now, and I'll add a note that a PR for #43 should also close out this issue.

skoshx added a commit that referenced this issue Dec 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants