Thanks for replying back. One way I know of is to read the documents. The first step in below code will retrieve the document and then we can write custom code to check if any attribute exists or not. Then we can add them as per step 2 and step 3.
//step 1
UserInfo user = container.readItem(user.getId(), new PartitionKey(user.getEmail()), UserInfo.class);
//step 2
CosmosPatchOperations patchOps = CosmosPatchOperations.create().add("/phone/2",12345).set("/address","123 Foobar");
//step 3
container.patchItem(user.getId(), new PartitionKey(user.getEmail()), patchOps, reqOps, UserInfo.class);
Referenced Article: Partial Document Update in Azure Cosmos DB