I want to add a timestamp as a custom key in firebase however I can't add it since it always gives me an error.
This is how I'm inserting into the database.
db.ref('items/').child(timestamp).set({
name: item,
type: type,
})
This is how I get the timestamp:
firebase.database.ServerValue.TIMESTAMP
And the error I get is Reference.child failed: First argument was an invalid path= "[object Object]". Paths must be non-empty strings and can't containt ., #, $, [ or ].
I don't understand what is going on here and if I add that same timestamp as a value of one child it adds it without and problem