I\'m using the Realtime Database with Google\'s Firebase, and I\'m trying to check if a child exists.
My database is structured as the following
- /
You can check snapshot.exists value.
NSString *roomId = @"room1";
FIRDatabaseReference *refUniqRoom = [[[[FIRDatabase database] reference]
child:@"rooms"]
child:roomId];
[refUniqRoom observeSingleEventOfType:FIRDataEventTypeValue
withBlock:^(FIRDataSnapshot * _Nonnull snapshot) {
bool isExists = snapshot.exists;
NSLog(@"%d", isExists);
}];