本文实例讲述了JavaScript数据库TaffyDB用法。分享给大家供大家参考。具体如下:
TaffyDB 是一个免费开源的 JavaScript 库,用于在 Web 上实现一个轻量级的数据访问层,也就是一个简单的数据库。
数据定义:
- var friends = new TAFFY(
- [
- {name:"Bob",
- gender:"M",
- married:"No",
- age:25,
- state:"NY",
- favorite_foods:["pizza","tacos"]},
- {name:"Joyce",
- gender:"F",
- married:"No",
- age:29,
- state:"WA",
- favorite_foods:["salad","cheese sticks"]},
- {name:"Dan",
- gender:"M",
- married:"No",
- age:29,
- state:"MT",
- favorite_foods:["pizza","hamburgers","BLTs"]},
- {name:"Sarah",
- gender:"F",
- married:"No",
- age:21,
- state:"ID",
- favorite_foods:["pizza","sushi"]}
- ]
- )
新闻热点
疑难解答
图片精选