New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How to save some of the data in separate bin? #7
Comments
At the moment, that's not possible. But it wouldn't be too difficult to extend the concept of the customizable serializer and provide hooks to customize how the session object is mapped to/from a record in Aerospike. I.e. we would need a new interface that provides two methods:
PR would be welcome. |
Resolves #7: Support custom mappings of session object to database record.
@umangkedia, please take a look at PR #10. I've added a new, customizable data mapper to replace the existing serializer. With the new data mapper interface, it's possible to map the session object to Aerospike record bins in any way you want. |
Resolves #7: Support custom mappings of session object to database record.
Resolves #7: Support custom mappings of session object to a database record.
@jhecking This should work fine. I have forked the repo for now as I needed few more changes like option to save the PK so that it is returned back while querying secondary index. |
@umangkedia, sure, let me know if you make some changes to your fork that you think should be merged back into the official copy. To save the record key on the server, you can set the client's default write policy like this:
And you can now supply a custom mapper to add extra bins to the record in the DB:
Here is a full, working example: https://gist.github.com/anonymous/c6367ee14c7c0eb7f42b34d7b76617e2 |
I was seeing the code and at the time of saving the session, it stringifies the object and saves it in one bin. I want to save some of the data in separate bin so that I can create a secondary index on them? Any way to do that?
The text was updated successfully, but these errors were encountered: