Skip to content

ignore model property while saving record in document db/cosmos db #122

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

Closed
dixitprashant444 opened this issue Sep 19, 2018 · 2 comments
Closed

Comments

@dixitprashant444
Copy link

I have a class:
public class Job
{
private String id;
private String type;
private boolean history;
}
I want to ignore "history" property while saving the record in collection.
I tried @JsonIgnore but this does not work. I can see "history": false in saved record inside document db.
I do not want "history" attribute inside my saved record/document.
We have @DynamoDBIgnore for Amazon dynamo db. Can you please suggest the work around for your SDK?

@dixitprashant444 dixitprashant444 changed the title ignore pojo property while saving record in documentdb ignore model property while saving record in documentdb Sep 19, 2018
@ealsur
Copy link
Member

ealsur commented Sep 20, 2018

@dixitprashant444 We have tested this scenario and found that JsonIgnore does work. Do you have any repro code that you can share with us?

@dixitprashant444
Copy link
Author

@ealsur Lombok annotation was preventing JsonIgnore to work properly. See this FasterXML/jackson-databind#1226
When I removed lombok annotations from my model class & wrote getters, setters & constructors then JsonIgnore started working.
Thanks for quick reply & confirmation that this was not an issue from your end.

@dixitprashant444 dixitprashant444 changed the title ignore model property while saving record in documentdb ignore model property while saving record in document db/cosmos db Sep 20, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants