@@ -646,7 +646,7 @@ void ReadDataEventsForLocalChanges(firebase::firestore::Firestore* db) {
646
646
// [START listen_document_local]
647
647
DocumentReference doc_ref = db->Collection (" cities" ).Document (" SF" );
648
648
doc_ref.AddSnapshotListener ([](const DocumentSnapshot& snapshot,
649
- Error error) {
649
+ Error error, const std::string& errorMsg ) {
650
650
if (error == Error::kErrorOk ) {
651
651
const char * source =
652
652
snapshot.metadata ().has_pending_writes () ? " Local" : " Server" ;
@@ -690,7 +690,7 @@ void ReadDataEventsForMetadataChanges(firebase::firestore::Firestore* db) {
690
690
DocumentReference doc_ref = db->Collection (" cities" ).Document (" SF" );
691
691
doc_ref.AddSnapshotListener (
692
692
MetadataChanges::kInclude ,
693
- [](const DocumentSnapshot& snapshot, Error error) { /* ... */ });
693
+ [](const DocumentSnapshot& snapshot, Error error, const std::string& errorMsg ) { /* ... */ });
694
694
// [END listen_with_metadata]
695
695
}
696
696
@@ -708,7 +708,7 @@ void ReadDataListenToMultipleDocumentsInCollection(
708
708
// [START listen_multiple]
709
709
db->Collection (" cities" )
710
710
.WhereEqualTo (" state" , FieldValue::String (" CA" ))
711
- .AddSnapshotListener ([](const QuerySnapshot& snapshot, Error error) {
711
+ .AddSnapshotListener ([](const QuerySnapshot& snapshot, Error error, const std::string& errorMsg ) {
712
712
if (error == Error::kErrorOk ) {
713
713
std::vector<std::string> cities;
714
714
std::cout << " Current cities in CA: " << error << ' \n ' ;
@@ -740,7 +740,7 @@ void ReadDataViewChangesBetweenSnapshots(firebase::firestore::Firestore* db) {
740
740
// [START listen_diffs]
741
741
db->Collection (" cities" )
742
742
.WhereEqualTo (" state" , FieldValue::String (" CA" ))
743
- .AddSnapshotListener ([](const QuerySnapshot& snapshot, Error error) {
743
+ .AddSnapshotListener ([](const QuerySnapshot& snapshot, Error error, const std::string& errorMsg ) {
744
744
if (error == Error::kErrorOk ) {
745
745
for (const DocumentChange& dc : snapshot.DocumentChanges ()) {
746
746
switch (dc.type ()) {
@@ -779,7 +779,7 @@ void ReadDataDetachListener(firebase::firestore::Firestore* db) {
779
779
// Add a listener
780
780
Query query = db->Collection (" cities" );
781
781
ListenerRegistration registration = query.AddSnapshotListener (
782
- [](const QuerySnapshot& snapshot, Error error) { /* ... */ });
782
+ [](const QuerySnapshot& snapshot, Error error, const std::string& errorMsg ) { /* ... */ });
783
783
// Stop listening to changes
784
784
registration.Remove ();
785
785
// [END detach_listener]
@@ -881,7 +881,7 @@ void ReadDataArrayInNotInOperators(firebase::firestore::Firestore* db) {
881
881
// [START cpp_in_filter]
882
882
CollectionReference cities_ref = db->Collection (" cities" );
883
883
884
- cities_ref.WhereIn (" country" , std::vector<FieldValue::String> { " USA" , " Japan" });
884
+ cities_ref.WhereIn (" country" , std::vector<std::string>{ FieldValue::String ( " USA" ), FieldValue::String ( " Japan" ) });
885
885
// [END cpp_in_filter]
886
886
887
887
// [START cpp_not_in_filter]
0 commit comments