create database in firebase code example

Example 1: add to firebase database

db.collection("cities").add({
    name: "Tokyo",
    country: "Japan"
})
.then(function(docRef) {
    console.log("Document written with ID: ", docRef.id);
})
.catch(function(error) {
    console.error("Error adding document: ", error);
});

Example 2: flutter firebase database

dependencies:  flutter:    sdk: flutter  firebase_database: 1.0.3

Example 3: flutter firebase database

void createRecord(){  databaseReference.child("1").set({    'title': 'Mastering EJB',    'description': 'Programming Guide for J2EE'  });  databaseReference.child("2").set({    'title': 'Flutter in Action',    'description': 'Complete Programming Guide to learn Flutter'  });}