updateOrReplace by field

Instead of having to use the record id, is it possible to use the createOrReplace method and search by one or multiple fields. e.g.
const user = await xata.db.Users.createOrReplace({name: "Tom Hanks", age: "66"}, { name: "Keanu Reeves" });
const user = await xata.db.Users.createOrReplace({name: "Tom Hanks", age: "66"}, { name: "Keanu Reeves" });
1 Reply
tsg
tsg2y ago
currently not, but that's something on my list to do. At the moment I think the only option is to do a findOne and then the createOrReplace. Or you can consider setting custom values for the id column.
Want results from more Discord servers?
Add your server