It should be possibly to do a write that fails if the document already exists, like is possible in the admin sdk. Instead I have to do something like: 1) Read the document 2) If it doesn't exist, read it again in a transaction 3) If it exists now do a dummy update so the transaction can succeed, otherwise create it.