Q:

Real time to firestore equlivant of .push()

I am converting my real-time database app over to firestore. The issue I can't figure out is in my app I am using .push() what is the firestore equivalent of this? I posted my code below just as a reference. Sorry if this is vague don't know what else to include 
@Override
protected void onCreate(@Nullable Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.chat_activity);

    firebaseFirestore = FirebaseFirestore.getInstance();
    mMessageDoc = firebaseFirestore.document("Messages");

    // mFirebaseDatabase = FirebaseDatabase.getInstance();
    // mMessagedatabaseReference = mFirebaseDatabase.getReference().child("messages");

    mFirebaseStorage = FirebaseStorage.getInstance();
    mChatPhotosStorageReference = mFirebaseStorage.getReference().child("chat_photos");

    // Initialize references to views
    mProgressBar = (ProgressBar) findViewById(R.id.progressBar);
    mMessageListView = (ListView) findViewById(R.id.messageListView);
    mPhotoPickerButton = (ImageButton) findViewById(R.id.photoPickerButton);
    mMessageEditText = (EditText) findViewById(R.id.messageEditText);
    mSendButton = (Button) findViewById(R.id.sendButton);

    mCurrentUser = FirebaseAuth.getInstance().getCurrentUser();
    final String current_uid = mCurrentUser.getUid();

    // Initialize progress bar
    mProgressBar.setVisibility(ProgressBar.INVISIBLE);

    //Initialize message ListView and its adapter
    List<FriendlyMessage> friendlyMessages = new ArrayList<>();
    mMessageAdapter = new MessageAdapter(this, R.layout.item_message, friendlyMessages);
    mMessageListView.setAdapter(mMessageAdapter);

    // ImagePickerButton shows an image picker to upload a image for a message
    mPhotoPickerButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            Intent galleryIntent = new Intent();
            galleryIntent.setType("image/*");
            galleryIntent.setAction(Intent.ACTION_GET_CONTENT);

            startActivityForResult(Intent.createChooser(galleryIntent, "Select Image"), GALLERY_PICK);
        }
    });

    // Enable Send button when there's text to send
    mMessageEditText.addTextChangedListener(new TextWatcher() {
        @Override
        public void beforeTextChanged(CharSequence charSequence, int i, int i1, int i2) {
        }

        @Override
        public void onTextChanged(CharSequence charSequence, int i, int i1, int i2) {
            if (charSequence.toString().trim().length() > 0) {
                mSendButton.setEnabled(true);
            } else {
                mSendButton.setEnabled(false);
            }
        }

        @Override
        public void afterTextChanged(Editable editable) {
        }
    });
    mMessageEditText.setFilters(new InputFilter[]{new InputFilter.LengthFilter(DEFAULT_MSG_LENGTH_LIMIT)});

    // Send button sends a message and clears the EditText
    mSendButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            FriendlyMessage friendlyMessage = new FriendlyMessage(mMessageEditText.getText().toString());
            mMessagedatabaseReference.push().setValue(friendlyMessage);
            // Clear input box
            mMessageEditText.setText("");
        }
    });

    mChildEventListner = new ChildEventListener() {
        @Override
        public void onChildAdded(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {
            FriendlyMessage friendlyMessage = dataSnapshot.getValue(FriendlyMessage.class);
            mMessageAdapter.add(friendlyMessage);
        }

        @Override
        public void onChildChanged(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {

        }

        @Override
        public void onChildRemoved(@NonNull DataSnapshot dataSnapshot) {

        }

        @Override
        public void onChildMoved(@NonNull DataSnapshot dataSnapshot, @Nullable String s) {

        }

        @Override
        public void onCancelled(@NonNull DatabaseError databaseError) {

        }
    };
    mMessagedatabaseReference.addChildEventListener(mChildEventListner);

    mSendButton.setOnClickListener(new View.OnClickListener() {
        @Override
        public void onClick(View view) {
            FriendlyMessage friendlyMessage = new FriendlyMessage(mMessageEditText.getText().toString(), current_uid, null);
            mMessagedatabaseReference.push().setValue(friendlyMessage);

            // Clear input box
            mMessageEditText.setText("");
        }
    });

}

@Override
protected void onActivityResult(int requestCode, int resultCode, Intent data) {
    super.onActivityResult(requestCode, resultCode, data);

    if (requestCode == GALLERY_PICK && resultCode == RESULT_OK) {

        Uri selectedImageUri = data.getData();

        final StorageReference photoRef = mChatPhotosStorageReference.child(selectedImageUri.getLastPathSegment());

        photoRef.putFile(selectedImageUri).addOnSuccessListener(new OnSuccessListener<UploadTask.TaskSnapshot>() {
            @Override
            public void onSuccess(UploadTask.TaskSnapshot taskSnapshot) {
                photoRef.getDownloadUrl().addOnSuccessListener(new OnSuccessListener<Uri>() {
                    @Override
                    public void onSuccess(Uri uri) {
                        String downloadUrl = uri.toString();
                        Log.d("tag", downloadUrl);
                        FriendlyMessage friendlyMessage = new FriendlyMessage(null, mUsername, downloadUrl);
                        mMessagedatabaseReference.push().setValue(friendlyMessage);
                        //Toast.makeText(ChatActivity.this, ), Toast.LENGTH_LONG).show();

                    }
                });
            }
        });

    }
}

A:

I didn't look into detail to your code but one may consider that the "equivalent" of
the Realtime Database push() method which "creates a reference to an auto-generated child location"
is
the Firestore add() method which "adds a new document to the collection with the specified data, assigning it a document ID automatically."

