Bongo.js
Bongo.js is a JavaScript library for storing and querying structured data on the browser. Lots of it.
It is built on IndexedDB.
It is tested in Chrome 27, Chrome 29, Firefox 22, and Internet Explorer 10.
Features
- Insert, save, remove, find, findOne
- Comparison query operators ($all, $lt, $lte, $gt, $gte, $in, $nin)
- Mongo-esque key generator (on _id)
- Pick, limit, skip
- Automatic versioning and database upgrades
- Custom filters
- 11k
Get started
Install
Use Bower:
bower install bongo.js
And include the file in your app:
You can also download the compressed, production version or the uncompressed, development version.
Define database
bongo;
insert
bongo;
save
bongo;
get
bongo;
find
bongo;
Regular expressions
bongo;
Comparison query operators
bongo;
$all, $lt, $lte, $gt, $gte, $in, $nin are supported.
findOne
bongo { if!error //success });
filter
bongo;
fields
bongo;
or
bongo;
limit
bongo;
skip
bongo;
remove
bongo
Or just use the key:
bongo;
Delete the database
bongo;
Check for support
ifbongosupported // Woo hoo!
Known issue
- After many(?) database version upgrades, sometimes Chrome needs to be restarted.
- Redefining the same database multiple times in the same pageload is problematic.
License
MIT. Forking is form of flattery.
See also
- Introduction to Bongo.js (slides)
- aaronpowell/db.js
- maxogden/level.js
- jensarps/IDBWrapper
- axemclion/IndexedDB
- grgrssll/IndexedDB
- ironfroggy/plasmid
- malucomarinero/johodb
- linq2indexeddb
- mozilla-b2g/gaia/async_storage.js
- superfeedr/indexeddb-backbonejs-adapter
- ytkyaw/ydn-db (adapter)
- brianleroux/lawnchair (adapter)
- daleharvey/pouchdb (adapter)
- facebook/IndexedDB-polyfill (polyfill)
- axemclion/IndexedDBShim (polyfill)
- Parashuram's IndexedDB Experiments