Class WriteResult (7.3.0)

A WriteResult wraps the write time set by the Firestore servers on sets(), updates(), and creates().

WriteResult

Package

@google-cloud/firestore

Constructors

(constructor)(_writeTime)

constructor(_writeTime: Timestamp);

Constructs a new instance of the WriteResult class

Parameter
NameDescription
_writeTime Timestamp

The time of the corresponding document write.

Properties

writeTime

get writeTime(): Timestamp;

The write time as set by the Firestore servers.

{Timestamp} WriteResult#writeTime

Example

let documentRef = firestore.doc('col/doc');

documentRef.set({foo: 'bar'}).then(writeResult => {
  console.log(`Document written at: ${writeResult.writeTime.toDate()}`);
});

Methods

isEqual(other)

isEqual(other: firestore.WriteResult): boolean;

Returns true if this WriteResult is equal to the provided value.

Parameter
NameDescription
other firestore.WriteResult

The value to compare against. true if this WriteResult is equal to the provided value.

Returns
TypeDescription
boolean