Skip to content

firestore.CreateIfMissingOption should be replaced #4111

@dhermes

Description

@dhermes

Paraphrased from @samtstern:

It's still possible to do

    city_ref.update({
        u'capital': True
    }, firestore.CreateIfMissingOption(True))

The other Firestore SDKs have removed this option and moved to an option on the set() operation called, merge(). For example, in the Android SDK:

db.collection("cities").document("BJ")
        .set(data, SetOptions.merge());

The new semantics make it so that the set() operation (and create() which some SDKs offer) is the only operation which can make a new document. The merge() option means that the data will be deep merged into any existing document, rather than just obliterating and replacing.

Metadata

Metadata

Assignees

Labels

api: firestoreIssues related to the Firestore API.priority: p2Moderately-important priority. Fix may not be included in next release.status: blockedResolving the issue is dependent on other work.type: feature request‘Nice-to-have’ improvement, new feature or different behavior or design.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions