data not saved in taffyDB

196 views Asked by At

i've started by creating a taffyDB like below. then i'm adding the data to the insert query, but my console message still return empty database. What am i doing wrong?

i've double checked all values in the insert query and none of them are empty.

var camps = TAFFY();

camps.insert({title: title.value, body: body.value, longitude: currentMarker.lng(), latitude: currentMarker.lat(), status: true});


console.log(camps());
1

There are 1 answers

0
Regis Silva On

Peter, I think the problem is that you did not put the field names in "". And TaffyDB does not advice about that.

The correct form would be

camps.insert({"title": title.value, "body": body.value, "longitude": currentMarker.lng(), "latitude": currentMarker.lat(), "status": true});

And remember if field data are string values they have to be put between "" also.