Q:

How to retrieve the last created object from Firebase Database on server side

I'm new to Firebase cloud functions so sorry if this is pretty straight forward.  I'm trying to receive the latest pushed object in my database.  Unfortunately this code returns every object that already was pushed in the database at '/customers'.  I already tried .onCreate but that didn't do anything at all. 
exports.newCustomer = functions.database.ref('/customers/').onWrite(event => {
  console.log(event.data.val());
});

A:

That onWrite event should only capture new data.  However maybe you should more specific like this:
exports.newCustomer = functions.database.ref('/customers/{randomID}').onWrite(event => {
  console.log(event.data.val()); //here is the data that is added
  console.log(event.params.randomID); // random ID
  console.log(event.data.val().firstName); //change firstName to anything you added. 
});

This will capture any write event to /customers/XXX/XXX/

