I am using mongoOperations of Spring Data mongodb to store in MongoDB// mongoOperations.save(reqObj);
I need to save the same JSON document which i am getting as rest API response in two collections.
@Document(collection="collection_a")
public class Response {
}
I am able to save in collection collection_a. I also need to save the same json in another collection collection_b.
Should I create another class like below and copy the value from Response to ResponseCopy? or is there better approach.
@Document(collection="collection_b")
public class ResponseCopy {
}