I have been trying to erase all document from collection and memory before adding new one. I tried it by following methods
1.
WL.JSONStore.get("users").findAll().then(function (arrayResults){
var options={push:true};
if(arrayResults.length>0){
for(var i=1;i<=arrayResults.length;i++){
WL.JSONStore.get("users").remove(i,options);
}
}
});
2.
WL.JSONStore.get("users").findAll().then(function (arrayResults){
var options={};
if(arrayResults.length>0){
for(var i=1;i<=arrayResults.length;i++){
WL.JSONStore.get("users").erase(i,options);
}
}
});
But didn't get success. Its showing all documents by doing findAll
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…