Class WriteResult (6.0.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
Name Description
_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
Name Description
other firestore.WriteResult

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

Returns
Type Description
boolean
Design a Mobile Site
View Site in Mobile | Classic
Share by: