Firestore - Reference Data Type - can I use it in the rules (exists or get functions)? - can I use it in the JS client?

I read the documentation and there is nothing there to understand what you can do with the reference data type.

This code comes in the documentation for the Security Rules:

  match /messages/{messageId} {
    allow read: if exists(/databases/$(database)/documents/rooms/$(roomId)/users/$(request.auth.uid));
  }

Instead of the previous code, I am wondering if you can do something like this:

  match /messages/{messageId} {
    allow read: if exists(resource.data.user_ref);
  }

or

  match /messages/{messageId} {
    allow read: if get(resource.data.user_ref).data.name == 'fran';
  }

My feelings are that is not possible to do that according to the documentation for get and exists functions The path provided must begin with /databases/$(database)/documents. because I can see that the reference stored in the DB is like this:

firestore.googleapis.com/project/x/database/(default)/documents/messages/messageId

And I'd like to know what can you do in the JS client, for example, something like this:

  var docRef = db.collection("messages/message1");

  docRef.get().then(function(doc) {
      var userDocRef = db.collection(doc.data().user_ref);
      userDocRef.get().then(function(userDoc) {
           console.log("User data:", userDoc.data());
      });
  });

I'll really appreciate if somebody can explain this data type in more detail with examples. Thanks in advance.