Skip to content

DocumentRef.update() does not respect withConverter setting #2116

@0xJem

Description

@0xJem

[READ] Step 1: Are you in the right place?

Yes.

[REQUIRED] Step 2: Describe your environment

  • Operating System version: macOS 13.2.1
  • Firebase SDK version: 11.5.0 of firebase-admin
  • Firebase Product: database
  • Node.js version: 18.2.1
  • NPM version: yarn 8.19.2

[REQUIRED] Step 3: Describe the problem

Steps to reproduce:

  1. Obtain a DocumentReference from a collection with the converter set.
  const firestoreClient = new firestore.Firestore();
  firestoreClient.settings({ ignoreUndefinedProperties: true });

  const testRef = firestoreClient
    .collection("tests")
    .withConverter(TestConverter)
    .doc(testId);
  1. Call testRef.update() with data.
testRef.update({
 key: value,
});

The functions in the converter, TestConverter, are not called.

However, if the following is performed instead, the functions in TestConverter are called:

testRef.set({
 key: value,
}, { merge: true});

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions