samedi 7 octobre 2017

Firestore web code sample

I am trying out the new Firestore by Firebase. When I run the code sample from http://ift.tt/2xoT0q2, I am getting an error.

// Add a new document with a generated id.
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);
});

Exception caught: (FirebaseError) : Function CollectionReference.add() requires its first argument to be of type object, but it was: a custom Object object

Is this a problem in the Firestore BETA?




Aucun commentaire:

Enregistrer un commentaire