我正在使用 Taffy DB 将数据存储在我的应用程序中。
我已经在 Taffy DB 中插入了数据,例如,
var teamList = TAFFY();
teamList.insert(data);
现在我想检查数据是否插入到数据库中。
请指教
我正在使用 Taffy DB 将数据存储在我的应用程序中。
我已经在 Taffy DB 中插入了数据,例如,
var teamList = TAFFY();
teamList.insert(data);
现在我想检查数据是否插入到数据库中。
请指教
要查看数据,您需要使用 Taffy Query
尝试:
console.log(teamList().get());
Taffy 查询返回一个包含数据的数组。
db().get(); // returns array with all stored data
您可以像这样在查询中使用 where:
db({column:value}).get(); - is like select * from table where column = value
尝试:
teamList.last();
返回最后添加的记录。