database?.setFilterNamed("MyFilter", as: { (revision, params) -> Bool in let typeParam = params?["type"] as? String let typeString = revision.document?.property(forKey: "type") as? String if typeParam == typeString{ return false } else{ return true } }) pushReplication?.filter = "MyFilter" pushReplication?.filterParams = ["type": "MyModule"]
let myModule = MyModule(forNewDocumentIn: database!) myModule.moduleDiskPath = "somePath" myModule.moduleName = "some name" do{ try myModule.save() }catch{ print("Encountered error: \(error) while saving module information") }
--
You received this message because you are subscribed to the Google Groups "Couchbase Mobile" group.
To unsubscribe from this group and stop receiving emails from it, send an email to mobile-couchbase+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/mobile-couchbase/FDC68752-D318-4550-A0AD-FD0D5CD296B1%40couchbase.com.
For more options, visit https://groups.google.com/d/optout.
revision.document?.properties?["type"] as? String
On May 1, 2017, at 12:43 AM, parvez....@decurtis.com wrote:but still then the intended document is getting synced to the Couchbase server.
I would like to repeat once again here that at sync gateway end there is no filter function written.