Como Firebase.database (). Ref empurre o ID exclusivo na mesma identificação de ID exclusiva
const ref = Firebase.database().ref(`/posts`);
ref.push({ title, categories, content, timestamp})
.then((snapshot) => {
ref.child(snapshot.key).update({"id": snapshot.key})
});
Brainy Bison