Skip to content

Indexed DB api wrapper with support for full text search and other. Functionality is similar in some way to MongoDB api,

Notifications You must be signed in to change notification settings

davidayalas/myDB

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 

Repository files navigation

IndexedDB abstraction object

davixyz@gmail.com http://about.me/david.ayala

v0.1


(You can create several DB or one DB with several stores/tables)

Sample:

var DB = new myDB("myDatabase",[ "store1", //only a storename "store2" : { // a storename with index properties "key" : "field1", "unique" : false } ]);

  • DB.add("store1",{"id":1,"key1":"value1","key2":value2,"key3":value3})

  • DB.add("store1",{"id":2,"key1":"value11","key2":value22,"key3":value33}) //myDB creates an internal index "myDBid" for each added record

  • DB.getAll("store1", function(results){ .... })

  • DB.get("store1",[ { "key":"key1", //key to query "type":"string", //data type. Optional, default "string" "content":"value", //value to query "compare":"equals" //method for compare. Optional, default "contains" }] , function(results){ .... });

  • DB.getByIndex("store1", "index", "exact query", function(results){ .... })

  • DB.delete("store1",[{"key":"id","type":"number","content":1}],function(){ .... });

  • Compare methods:

    • "string" : "equals","contains","different"
    • "date" && "number": "equals","different","lte", "gte", "gt", "lt" ("l"="lower" "g"="greater" "t"="than" "e"="equals" lte= "<=")
    • "fulltext": performs a string search over all the fields in the db (v0.3)

v0.2


It flattens search strings and string in DB to ingnore diacritical accents [áà èé...]

v0.3


Full text search simulation

v0.4


Some improvements because myDB failed due to some changes in Google Chrome indexedDB api

v0.4.2


search over values equal to zero

v0.4.3


little improvements in transactions modes and in opening and upgrading database

About

Indexed DB api wrapper with support for full text search and other. Functionality is similar in some way to MongoDB api,

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published