Nuha Dzikri
Nuha Dzikri

Reputation: 608

Firebase push() collections item key, when is it generated?

Firebase push() collections item key, is it generated immediately on client side or after sync done?

eg this code:

var messageListRef = new Firebase('https://SampleChat.firebaseIO-demo.com/message_list');
messageListRef.push({ 'user_id': 'fred', 'text': 'Yabba Dabba Doo!' });

And if immediately generated on client side, how can i acquire it immediately? without using callback

Upvotes: 2

Views: 163

Answers (1)

Frank van Puffelen
Frank van Puffelen

Reputation: 599491

Firebase's push ids are generated client-side. That's why they continue to work when you're not connected to the server.

See:

Upvotes: 2

Related Questions