Custom Transformers
If you don't like how we set up data serialization or just have super-custom requirements, you can provide your own data marshaller to have full control. Create a CFC that implements the cfcouchbase.data.IDataMarshaller
interface. It only needs to have three methods:
serializeData()
- Returns the data in a string form so it can be persisted in CouchbasedeserializeData()
- Received the raw string data from Couchbase and inflates it as necessary to the original statesetCouchbaseClient()
- Gives the marshaller a chance to store a local reference to the client in case it needs to talk back.
myDataMarshaller.cfc
After you have created your custom marshaller, simply pass in an instance of it or the full component path as a config setting:
Tip Once you specify a custom data marshaller, you are overriding all Data Serialization functionality above. So you are on your own now buddy! Like good 'ol spidey says: With Much Power Comes Much Responsibility!
Last updated