Last active
August 29, 2015 14:25
-
-
Save ronycohen/60cf935ee279cd219db7 to your computer and use it in GitHub Desktop.
server side filtering
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "_id": "_design/app", | |
| "_rev": "13-1d2cab1b97b2ceb3b85ce7399a5a4c84", | |
| "filters": "{'appfilter': function(doc) {return doc._id === '_design/app' || !doc._id.indexOf('relationstate') > -1 || !doc._id.indexOf('$email') > -1}.toString()}" | |
| } | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| localDB.sync(remoteDB, options) | |
| ==> | |
| options = { | |
| batch_size : 1000, | |
| live: live, | |
| filter: 'app/appfilter', | |
| retry : true, | |
| filter : function(item) { | |
| var type = factory.parse_id(item._id).type || item.type; | |
| console.debug(type); | |
| return type != 'forcedFreq' && type != 'preference' && type != 'exchangeType' && type != '$email' && type !='relationstate'; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment