OR or IN operation in IndexedDB

前端 未结 4 873
一整个雨季
一整个雨季 2020-12-19 14:19

Is there a way to do an OR or IN query on the same property in IndexedDB?

Another word, how do I get the results for,

SELECT * FROM MyTable WHERE col         


        
4条回答
  •  有刺的猬
    2020-12-19 14:48

    This is a simple query equivalent to your sql query using JsStore Library

    var Connection = new JsStore.Instance("MyDatabase");
    Connection.select({
        From: "MyTable",
        Where:{
            columnA : {In:['ABC','DFT')]},
            columnB : '123thd'
        },
        OnSuccess:function (results){
            console.log(results);
        },
        OnError:function (error) {
            console.log(error);
        }
    });
    

    Hope this will save your time and code:).

提交回复
热议问题