type User struct {
ID string `json:"id"`
Name string `json:"name"`
Email string `json:"email"`
Password string `json:"passwprd"`
Confirmed int `json:"confirmed"`
ConfirmCode string `json:"confirmcode"`
CreatedAt time.Time
UpdatedAt time.Time
}
Now, Whenever I am inserting data, all is fine, But whenever I update a specific bin Confirmed & ConfirmCode, my all other data is replaced with blank value too.
That would be odd for default struct behavior to be replace instead of upsert as with all bin operations… I haven’t touched Go yet but plan to. What’s your client/server version? Does it behave as you expect if using bins instead of struct?
The Go client does not check for zero values, since that would make it unpredictable as to what to do with default values. As a result, all fields are always marshaled and sent to the server.
The correct solution is what you have already done: you need to send all data to the server, or use the Go client’s dedicated API, which is faster and more refined.
The *Object class of functions are convenient API meant for beginners. These functions use reflection internally, and are limited in the scope of their functionality.
If you need to use all the capabilities of the Aerospike server, you have to use the other API without the Object in their names. Alternatively, you can build your app via the as_performance build tag and see if it compiles. If it doesn’t, it means you have used a function that uses reflection behind the scenes.
See, It’s always good to point resource or atleast provide some hint to search relevants resources. I am finding hard time understanding your below points -
you have to use the other API without the Object in their names
you can build your app via the as_performance build tag and see if it compiles
The *Object class of functions are convenient API meant for beginners.
In first, I could not understand what object name you are pointing here.
In second, I will check what is as_performance as I was not aware of until now.
In third, which object class, do you mean struct method, I am using or GetObject, PutObject, that is being used. Do you mean to insert, update directing using bin method?