Skip to content

Instantly share code, notes, and snippets.

@ronycohen
ronycohen / Sync Configuration
Last active August 29, 2015 14:25
server side filtering
localDB.sync(remoteDB, options)
==>
options = {
batch_size : 1000,
live: live,
filter: 'app/appfilter',
retry : true,
<ion-view title="Relation" cache-view="true" >
<div class="tabs tabs-top tabs-balanced has-subheader">
<a class= "tab-item" ng-class="{'tab-item-active':slideIndex==0}" ng-click="changeSlide(0)">
Echanges
</a>
<a class= "tab-item" ng-class="{'tab-item-active':slideIndex==1}" ng-click="changeSlide(1)">
Infos
</a>
<!-- <a class= "tab-item" ng-class="{'tab-item-active':slideIndex==2}" ng-click="changeSlide(2)">
@ronycohen
ronycohen / gist:f74d006c5ccbd4fe46b6
Created April 7, 2015 14:12
relational pouch - use of BulkDocs from a JSON.
multiSave : function(json, type){
console.info("multiSave", type);
json.map(function(obj,i){
console.debug(obj, i);
obj._id = factory.db.rel.makeDocID({ "type": type, "id": i+1 });
});
factory.db.bulkDocs(json).then(function (result) {
console.debug("load ok", result);
// handle result
}).catch(function (err) {